-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Flash Size setting bug #314
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
Comments
As far as I understand the concept, this setting is currently used to adjust the size of the flash file system. |
If you try the other two official board present in this core, and compile, you receive a compilation message about 2M of flash and 4M of flash, so it is related to flash size not Spiffs size |
The concept of "Maximum program storage space" is a bit complicated, as we have two segments for code (.text and .irom0.text) which may be filled independently. This message is not easy to customize because it is generated by the IDE. The best we can do is show the space used/available in one of the segments — probably .irom.text because this is where user's code and libraries go by default. So just to clarify: flash size settings do work, but this message is not based on correct flash size. |
thanks for the explanation, i think that it is not only a cosmetic problem, because the Arduino IDE, at least on Atmel mcu, do not upload the code if during compilation the size of code exceed the maximum board size. So it is important that all board.txt have correct number in it.
a question, if i use a 4MB flash, why the maximum code space can be only 1MB and the other 3MB must be for SPIFFS ? Is it not possible use 2M+2M ? |
Thanks, I forgot to update other boards. I haven't yet seen a sketch which would use over 1M flash. If you have such
|
@Testato The reason this property is important on AVRs is that they use a generic linker script which doesn't define the correct program segment size (as it varies from one part to another). With ESPs we use different linker scripts for each flash size, so linker know exactly how much code will fit. So when you try to put too much code, you will get an error from the linker which will say that "section .irom0.text will not fit into segment irom0_seg", and the IDE will not try to upload the sketch. |
And this is true also in the other way ? Example if we set maximum_size to 512KB, but we have a real bigger Flash memory, Arduino IDE do not stop the upload ? |
If you build the sketch with a linker script for 512k flash and the upload it to 1M flash, it will run. In fact, it's not easily possible to identify the real flash size during upload... The only way I know of is to read the flash ID and hope that the second byte will give you the flash size (as in 2^n). Unfortunately this doesn't hold true for all flash chip manufacturers. |
Ok, thanks In arduino is there another very usefull info, the static ram usage info. Is it simple implement it on this core also ? Do you prefer i open a new issue for this ? Example:
|
RAM usage is also shown after the update:
|
When we can update via board manager to this version ? |
Installed last Arduino Core by your Board Manager json url
Result: Sketch uses 197,372 bytes (37%) of program storage space. Maximum is 524,288 bytes.
The Flash Size setting do not work, on every value that you try, 4M, 2M, 1M, etc Arduino IDE compile always for 512K
The text was updated successfully, but these errors were encountered: