Page 1 of 1

chibios - demo binary size

Posted: Sat Nov 10, 2018 6:08 am
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.

Re: chibios - demo binary size

Posted: Sat Nov 10, 2018 9:24 am
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

Re: chibios - demo binary size

Posted: Sat Nov 10, 2018 1:49 pm
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

Re: chibios - demo binary size

Posted: Sat Nov 10, 2018 5:53 pm
by chibi-habibi
@steved/@giovanni: Thanks for the quick responses -- will check it out.