STM32F HAL Library too large

  • A+

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?


Try to:

  • eliminate unused code and data ("garbage collection") using -ffunction-sections and -fdata-sections for compiler, --gc-sections for linker .
  • use linker-time optimization (LTO) using -O2 -flto both for linker and compiler.


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: