Hi expert,
I want to optimize my code size(flash size) and RAM used size for my Cortex-M0 MCU(32KB flash and 2KB RAM). Does anyone share some tips for how to optimize? And I'm using Keil with v5 compiler.
How to write code in a way to reduce the overall code size is not something I can summarize here.
But from armcc v5.x compiler point of view, you need to set the correct compiler optimization level option, e.g. -Ospace, in order to achieve optimal code size
https://www.keil.com/support/man/docs/armcc/armcc_chr1359124221443.htm
https://www.keil.com/support/man/docs/armcc/armcc_chr1359124935804.htm