What do you do to significantly reduce code size? STM32F0 with 32KB Flash Overflowed
Hey there,
I have an STM32F042K6 with 32 KB flash which works with a whole bunch of peripherals using STM32 HAL and a lot of code. Now that everything is configured, it is overflowed by nearly 1.5KB (region `FLASH' overflowed by 1464 bytes).
What I'll need to do is a significant reduction of code size. I've already turned on all optimization flags -Os, -fmerge-all-constants, -ffunction-sections and -fdata-sections. What else do you do to reduce the code size?
Active peripherals:
ADC1, I2C1, SPI1, DMA for SPI1, Timer 2, Timer 16, DMA for timer 2, UART2, USB CDC as VCP
I'm not using any (emulated) floating point and no division at all which saved a lot of space already, but 99% of the code feels like is taken away by HAL.
Thank you for your help.
