How-To: Huge improvement in firmware size! #1147
Replies: 3 comments 1 reply
-
|
Note: This will increase function call times and may affect the timing of some cores. (This flag effectively turns 1 function call into 3 - 1 for the prologue, 1 for the function itself, and 1 for the epilogue.) |
Beta Was this translation helpful? Give feedback.
-
|
I added it to the build script and oscr_tool.ps1 so we can test it until the next release. |
Beta Was this translation helpful? Give feedback.
-
|
Here's the impact on the firmware rework (assumes HW5): Defaults (Minimal) After Defaults (OBM) + All Hardware Features Enabled After |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Create the following text file inside the specified folder below from the unzipped release package:
Arduino IDE\hardware\arduino\avr\platform.local.txtAdd the following contents to it then save it:
Next time the Arduino IDE is opened, it will optmize the code generation even further.
These are the results for the same Config.h, before and after the code optimization.
Before:
After:
That's saving almost 12KB from flash, which is huge! Added to that I'm plagued with the bootloader bug that prevents me to use the last 8KB usable page from flash, so this is came in handy! 😅
Hope this is useful to anyone else!
Suggestion: bundle this additional configuration file with the next release packages! 🙏
Beta Was this translation helpful? Give feedback.
All reactions