Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report/Annoyance: 3.2.0 uses twice the program memory of 3.1.0 #135

Closed
Andon-A opened this issue May 17, 2018 · 4 comments
Closed

Bug Report/Annoyance: 3.2.0 uses twice the program memory of 3.1.0 #135

Andon-A opened this issue May 17, 2018 · 4 comments
Assignees
Labels
bug Identifies a bug in the current version of the code
Milestone

Comments

@Andon-A
Copy link

Andon-A commented May 17, 2018

GitHub issue state GitHub issue title
GitHub issue author GitHub issue label GitHub issue comments
GitHub issue age GitHub issue last update

---------------------------- DO NOT DELETE OR EDIT anything above this line ----------------------------

Arduino IDE 1.8.5, using alternately SPIFlash 3.1.0 and SPIMemory 3.2.0, under Windows 10.

RUNDIAGNOSTIC and PRINTNAMECHANGEALERT (Lines 36 and 64) in SPIFlash.h are commented out to save space for 3.1.0
RUNDIAGNOSTIC (Line 35) in SPIMemory.h is commented out to save space for 3.2.0

Board settings are Arduino Pro/Pro Mini, ATMega328p, 3.3v/8mHz

The following code compiles to 2784 bytes in 3.1.0:

#include <SPIFlash.h>
SPIFlash flash(5);

void setup() {
  flash.begin();
}

void loop() {

}

Replacing SPIFlash.h with SPIMemory.h for using with 3.2.0 compiles with 5636 bytes, over double that of 3.1.0.

This is of particular interest to me as the program I am using it in compiles to precisely 30720 bytes with 3.1.0 - The maximum a 328p can utilize. For ease of users compiling their own code, I would like to be able to give simple instructions on what needs to be commented out. For 3.1.0, this is "Comment out lines 36 and 64 in SPIFlash.h" - For 3.2.0 this "Simple" memory saver doesn't work.

I haven't had time to investigate the cause of the space usage increase (I'm flying out to Seattle tomorrow morning), but I feel such incredible balooning seems to be a bug.

If this is expected performance, then this can be treated as a feature request for space saving measures.

@Marzogh Marzogh self-assigned this May 17, 2018
@Marzogh Marzogh added the bug Identifies a bug in the current version of the code label May 17, 2018
@Marzogh Marzogh added this to the v3.2.1 milestone May 17, 2018
@Marzogh
Copy link
Owner

Marzogh commented May 17, 2018

Ugh! That's something that I missed with the name change issue.

I will fix this for you ASAP and get a bugfix release out within a week with the option of turning off the new features. That should take the memory footprint back down. Thanks for catching it.

@Marzogh
Copy link
Owner

Marzogh commented May 17, 2018

Commit e24a2bc fixes this issue and ea26a05 & c0acadd reduce the footprint even further. If you make sure that #define RUNDIAGNOSTIC and #define USES_SFDP are commented out in SPIMemory.h, your code is currently compiling to 30342 30334 30326 bytes instead of the previous 30720 bytes in v3.1.0. Feel free to use the code from the development branch for now. I have a few more changes to make before the code goes stable and I push out v 3.2.1

Marzogh added a commit that referenced this issue May 21, 2018
…dy to go.

Relative to v3.2.0 this version (v3.2.1) reduces compiled code memory
footprint by 24% and 12%, with SFDP discovery turned off and turned on
respectively.
@Andon-A
Copy link
Author

Andon-A commented May 22, 2018

I've been away pretty much since I posted this. Awesome to come back to! Thanks a lot.

@Marzogh
Copy link
Owner

Marzogh commented May 23, 2018

Anytime! v3.2.1 is currently out in the wild and should fix the problem you had. 🙂👍🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies a bug in the current version of the code
Projects
None yet
Development

No branches or pull requests

2 participants