I have a custom board using STM32L031F6 with 32K flash 8K ram. Using a Mac with Black Magic Probe which works for uploading. However when I try to start PIO Debug (skip Pre-Debug) the debug control panel pops up briefly and then disappears before initializing is complete.
I’ve had to pre-build with the -Os flag as the the normal Debug build does not fit in flash memory.
I also just learned more about platformio! Never noticed the Debug Console tab.
Linking .pio/build/L031F6/firmware.elf
/Users/buster/.platformio/packages/toolchain-gccarmnoneeabi@1.90301.200702/bin/…/lib/gcc/arm-none-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld: .pio/build/L031F6/firmware.elf section .rodata' will not fit in region FLASH’
/Users/buster/.platformio/packages/toolchain-gccarmnoneeabi@1.90301.200702/bin/…/lib/gcc/arm-none-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld: region `FLASH’ overflowed by 2236 bytes
collect2: error: ld returned 1 exit status
*** [.pio/build/L031F6/firmware.elf] Error 1
========================== [FAILED] Took 4.62 seconds ==========================
So even with without Pre-Debug it is still building again with gcc options that cause overflow. What is the best way to override the flags in this step?