-
Notifications
You must be signed in to change notification settings - Fork 126
added PROGMEM size check #227
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
Conversation
To humor you (and everybody who got annoyed by this issue), I wrote a blog post. |
Thank you for doing the deep dive and providing a proper solution! I'm quite busy at the moment, but I'll happily test and merge a PR is you submit one for MegaCore and MightyCore |
I just noted that the PROGMEM section in the README.md also needed adaptation. |
avr/scripts/progmemcheck.bat
Outdated
echo _______________________________________________________________ | ||
echo ^| Severe Warning: PROGMEM section too large by %excess% bytes. ^| | ||
echo ^| Your program will most probably be unstable! ^| | ||
echo ^| Use the macro PROGMEM_FAR from ^<progmem_far.h^> and ^| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"progmem_far.h" is too vague. The user won't be able to understand what is being suggested from this information. I know you provide a detailed explanation in the documentation, but the average user isn't going to read that, and it is possible to communicate this concept much more clearly without any significant increase in the verbosity of the message.
It would be better to say something like:
Use the macro PROGMEM_FAR from the "progmem_far" library (available from Arduino Library Manager)
Couldn't |
Sure! Shall I include it in the PR? I guess Per is right about the message when it comes to the Arduino core. If the library is included in MegaCore, I would then change the message to 'Use the macro PROGMEM_FAR from the MegaCore library "progmem_far" and ...' |
Co-authored-by: Per Tillisch <[email protected]>
Wording changed and progmem_far included. |
Co-authored-by: Per Tillisch <[email protected]>
Sorry for being silent for so long. Been busy with other things, mostly children. The PR looks good to me! I will merge it in a few days if I don't hear anything. |
I have added two scripts (one Unix, one Windows) in the script directory that check whether the PROGMEM memory section below the 64k limit is exhausted. If so, a warning message is given. The script is called by abusing the objcopy recipe in platform.txt. The main thing is that the warning points out to use the PROGMEM_FAR macro from progmem_far.h, which you can install with the Arduino library manager. If you install the progmem_far library, you can try out the Arduino IDE on the two example programs
progmem_fail
andprogmem_repaired
.