Is it possible to use MCUXpresso with MKL03Z8?An "empty" project almost fills 8K Flash

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Is it possible to use MCUXpresso with MKL03Z8?An "empty" project almost fills 8K Flash

813 次查看
diegocolombo
Contributor IV

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

标记 (1)
0 项奖励
2 回复数

768 次查看
ErichStyger
Senior Contributor V

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

0 项奖励

777 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

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.

Pavel_Hernandez_2-1645218386142.png

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.

Pavel_Hernandez_1-1645218367407.png

I suggest use "volatile" for the IRQ.

Regards.

Pavel_Hernandez

0 项奖励