STM32 Maple Library paths included in flash memory


A lot of library path information looks to be programmed into the STM32 flash memory.
If I read back the programmed memory of the STM32 with the ST32 ST-Link utility I see a lot of the following entries:


Is there a build option that I can set to remove that information and decrease the flash memory footprint?

platform = ststm32
board = genericSTM32F103CB ;128k
framework = arduino
board_build.core = maple ; use Arduino STM32 (maple)
board_build.variant = maple ; use Arduino STM32 (maple)
upload_flags =

  • -c*
  • set CPUTAPID 0x1ba01477 ; Original STM32F103 parts*
    debug_tool = stlink


The output is generated from ASSERT() expressions in the code as a means of error-catching

Whereas ASSERT() expands to

So this is where the __FILE__ and __LINE information come from and your path informatin is included.

This code also shows that this code can be deactivated when DEBUG_LEVEL < DEBUG_ALL aka DEBUG_NONE or DEBUG_FAULT (see surrounding code). So just add

build_flags = -D DEBUG_LEVEL=0

and it evaluates to an empty expression and your problem is solved…

1 Like

Hello Max,

Thanks for the quick reply and the excellent explanation!
Adding build_flags = -D DEBUG_LEVEL=0 shaved ~3K off the memory usage.


1 Like