How to reduce code size?

Post here first, or if you can't find a relevant section!
Post Reply
hbozyq
Posts: 1
Joined: Sat Apr 24, 2021 7:26 am

How to reduce code size?

Post 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!
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: How to reduce code size?

Post 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.
Post Reply

Return to “General discussion”