chibios - demo binary size

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
chibi-habibi
Posts: 4
Joined: Sat Nov 10, 2018 5:46 am

chibios - demo binary size

Post by chibi-habibi »

Hello folks,

I have started playing with latest version (18.2.1), and the built binary for F412ZG demo is around 300kB. When I was using CubeMX and freertos demo for usb, the code size was 30kB. What are some of the things you suggest me to look at in the config/build process. I am a relative newbie so any insights would help! Thanks.
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: chibios - demo binary size

Post by steved »

Usually the test harness is included in the build, which generates a printout to some serial port triggered by a button on the hardware.

Look in the loop at the end of main() to see this; remove the call, and maybe remove from makefile
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: chibios - demo binary size

Post by Giovanni »

Correct, you need to remove the test code from the demo and make sure to compile using -O2, some demos are defaulted to -O0 (no optimizations).

Giovanni
chibi-habibi
Posts: 4
Joined: Sat Nov 10, 2018 5:46 am

Re: chibios - demo binary size

Post by chibi-habibi »

@steved/@giovanni: Thanks for the quick responses -- will check it out.
Post Reply