Link optimization

Hi folks,

I’m using Arduino IDE in Windows to develop guitar effects with Daisy Seed, and selecting normal board configuration. I had no problems so far, but as the application gets bigger, I could not fit it in the FLASH memory anymore. I got the error message:

“c:/users/user/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: C:\Users\USER\AppData\Local\Temp\arduino_build_732769/ds_chain.ino.elf section .sram1_bss' will not fit in region FLASH’
c:/users/user/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: region `FLASH’ overflowed by 21252 bytes
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Generic STM32H7 Series.”

The solution was to exchange processor velocity with program size in the linker. So I selected “Smallest (-Os) with LTO” instead of “Fastest (-O3)” although I must confess I don’t know exactly what this means. That option was the only one capable to upload the program in DS without any error. On the other hand, the Serial interface (that I use for debugging) is missing. I got error COM6 is missing. Is this the normal expected behavior? Is there something that I could do to keep the serial interface?
Thank you