Hello
I'm very new about MCUXpresso,i spent years with Kinetis Design Studio,and ,working with very small-entry level microcontrollers, I was discouraged to use MCUXpresso anytime I tried.
For example,a new C project,with no semihosting,no peripherals enabled( I mean ,no ADC,no LPTMR..),no rows of code added by me ,Redlib(nohost-nf) occupies 6736 bytes,82,3% of available Flash(and I still need a 1024 bytes sector for saving some data)
If I select necessary peripherals using SDK Manage Components (ADC,GPIO,PORT,LPTMR,TPM and SPI)
I got PROGRAM_FLASH: 7532 B 8 KB 91.94%.
I could configure peripherals by hand at register level,but i could find that space will miss, writing my own code.
Is there any way to save some space?
Thanks,
Diego
Hi @diegocolombo ,
I suggest you check out an article I wrote on that topic: https://mcuoneclipse.com/2019/08/17/tutorial-how-to-optimize-code-and-ram-size/
It is for a different board/MCU, but the same principles apply. I quickly tried this with the KL03Z, and that way you get easily the code size down to 1.5 kByte. This is kind of the base size without too much limitations, because it includes the necessary clock settings, system and startup code.
That way I even have FreeRTOS running on my KL03Z projects: there is not much legroom on it, but does the job and makes it easy to use.
I hope this helps,
Erich
Hello diegocolombo
I replayed your case and if you want to save more space use the -Release build- to optimize your code for better result.
Or I suggest try this option too. Click right in your Project/Properties/C-C++Build/Settings/Tool Settings/Optimization/ and try the different level of optimization.
I suggest use "volatile" for the IRQ.
Regards.
Pavel_Hernandez