I just ran out of flash on my microcontroller project. How can I reduce the size of the HAL library or otherwise make it take less of a huge percentage of my project?
- eliminate unused code and data ("garbage collection") using
--gc-sectionsfor linker .
- use linker-time optimization (LTO) using
-O2 -fltoboth for linker and compiler.