Kinetis MCU Problem

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

Kinetis MCU Problem

570 次查看
mustafa_tarhan
Contributor II

Our customer is programming MK20DX128VLF5  by using Kinetis Design Studio 3.0.0 

They would like to store data in FlexNVM and later on want to transfer this data to USB. In the same time, they are using ADC, Flex Timer and Uart modul in the same project.

They have seperated in to 24kb D-flash and 8kb for eeprom backup for data storage. Flex NVM space has been identified as you can see in the attached .ld file.

They were able to write and transfer data in the code at 0x1000. Code size has been increased since they want to use UART module and later on they need to optimize it. see optimization options in the attached file.

They did not face with any problem after optimisation. They have changed the data amount from 0x1000 to 0x6000.

After this change, device reset it self while transferring data to USB.

The reason was SW reset because of the code. When they check from debug window, then they saw attached result.

However, this USB commands are not changing as you can see in the .ld file

There are some questions that they have.

 

1-) what is the IDE that you suggest for the new project? does our mcu support MCUXpresso IDE?

2-) Used RAM and flash size calculation? In the internet it was calculated as below.

 text+data = Flash size; bss+data = Ram size.

Is it true? is there any way to see RAM and flash size as % or any other format .map file or in IDE? 

3-) What is the max stack and heap size? can we visiulase requested or needed size?

4-) How can we make code optimisation and make sure that this optimisation does not brake our code?

标签 (1)
标记 (1)
0 项奖励
1 回复

467 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi Mustafa,

1-) what is the IDE that you suggest for the new project? does our MCU support MCUXpresso IDE?

You can use KDS3.2/CW11/Keil/IAR. All these IDE can support MK20DX128xxx5. Of course KDS3.2 is for free. MCUXpresso almost doesn't support MK20DX128xxx5. Because there isn't MK20CX128xxx5 SDK.

2-) Used RAM and flash size calculation? In the internet it was calculated as below.

 text+data = Flash size; bss+data = Ram size.

Is it true? is there any way to see RAM and flash size as % or any other format .map file or in IDE? 

Yes, this is right. You can let console window print size.

Untitled3.png

It seems the gcc linker in KDS does not support - Xlinker -print-memory-usage. Please refer to below link.

https://community.nxp.com/thread/301618

3-) What is the max stack and heap size? can we visualize requested or needed size?

The max stack and heap size is depend on RAM size and RAM allocation. If you want to see the real usage, you can fill the heap and stack with 0xff or 0x0. Then run the code for a long time, observe the memory values in heap and stack.

4-) How can we make code optimization and make sure that this optimization does not brake our code?

I think the optimization is ok. There are different reason for optimize error. For example,

Error in Optimized Code (pre-increment) 

ADC Access Failing when Optimized (-O != 0) 

I can't figure out why you have the problem from your picture. It need more debug.

Regards,

Jing

0 项奖励