Content originally posted in LPCWare by CodeRedSupport on Tue Sep 14 23:41:38 MST 2010
When I build your example (and CMSIS) for release, I end up with a code size of 1.7k.
Are you comparing eggs with eggs. Are you building the exact same code (including CMSIS) with both toolchains?
Don't forget that for noddy examples like this, the library code (startup code, CMSIS, and C runtime) tends to dominate. When you start adding more of your own code, then your code will dominate over the library code. In our experiments, in terms of code size, GCC is pretty close to 'commercial' - sometimes it is bigger, sometimes it is smaller.