If you have not noticed: the final CodeWarrior for MCU10.3 has been released on the Freescale web :-).
It comes with a few changes compared to the 10.3beta release, and one is about the library configuration. I noticed that new projects created with the wizard are around 4 KByte larger than I expect them to be. For example my rather simple application below uses 8 KByte of code, where my expectation would be in the range of around 4 KByte:
text data bss dec hex filename 8644 24 1108 9776 2630 Freedom_2x16_HTA.elf
💡 See this post how to show the code/data size after the link phase.
Maybe you remember my trick I have published here around the __pformatter symbols. The good news is: that trick is not needed any more. The not so good news is: it requires a different setting to get rid of the not needed printf() support.
The 💡 trick is to use the right library option.
By default the project wizard sets up the project to use EWL (Embedded Warrior Library) to use ‘ewl with int’ for GNU gcc:
Compared to normal GNU gcc libraries, EWL is better suited for embedded systems. However, EWL still comes with too much overhead in my view for true embedded projects. And even if I do *not* use any printf() or scanf() in my application, the above settings are adding a huge (in my view) overhead to my code.
The good news is: it is very easy to get rid of that overhead: Simply configure it to use EWL with ‘ewl_noio’:
With this option set, I’m back to what I expect: 4 Kbyte of code:
text data bss dec hex filename 4168 24 1108 5300 14b4 Freedom_2x16_HTA.elf
Happy Reducing 🙂