Page 1 of 1

How to reduce code size?

Posted: Sat Apr 24, 2021 8:40 am
by hbozyq
Hi everyone.
I just updated the STM32 boards support to 2.0.0 and found that the code size is striking bigger.
To be exact its 20% bigger than 1.9.0 and is overflowed (same -Os optimisze).
I dont want to change the MCU so is theres any way to reduce the code size? Such as remove some not unused peripheral or something.
And whats inside the arduino support made it so plump compared with the bare HAL library?
I am using F103C8 board with the Arduino IDE. Any explanation is welcomed.Thanks in advance!

Re: How to reduce code size?

Posted: Sat Apr 24, 2021 10:16 am
by fpiSTM
In fact now you have access to all pins available for a peripheral in the peripheralpins.c. Simply redefine all pinmap array at sketch levelwith only pins you need.

I will update the wiki next week to explain all changes.
Anyway pinmap array redefinition is already explained in the wiki.