Preserve Flash Memory with Debug Build (Debug as)

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

Preserve Flash Memory with Debug Build (Debug as)

跳至解决方案
991 次查看
davidzhou
Contributor V

Hi ,

I have K60 tower board, and am using Code Warrior 10.6.4 with MQX 4.2

 

I am using part of flash memory for system configuration. System Configuration data is saved. But every time if I reload firmware, the data is cleared. So I want to exclude 0x60000 to oxFFFFF flash memory and only designate 0x0 to 0x60000 for code area. It works if it is release build. (See Advanced Options below). But for debug mode, the debugger aborts after the Preserve this Range (Range1) is checked and sets to from 0x60000 to 0xFFFFF.

Second: Now the debugger desn't work even if Preserve is unchecked and addresses boxes are reset to 0x0. I have to create a new debug connection to fix the problem.

 

170721_170721.pngpastedImage_1.png

 

170722_170722.pngpastedImage_2.png

 

 

Thank you,

David Zhou

标签 (1)
0 项奖励
回复
1 解答
738 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David,

In the normal mode , do not preserve some range, does it can download successful ?

If not,  please first test a simple project , and do you use the SWD or JTAG debug ? If

SWD, please check it :

pastedImage_1.png

I see you use the K60F120 chip, i also test on it, also use the Multilink Universal FX revB,

it can work well . So i recommend you carefully re-open CW, connect , configure it .

BR

Alice

在原帖中查看解决方案

0 项奖励
回复
5 回复数
738 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David,

Please check the debug configurations view , do not enable the "Always mass erase on connect":pastedImage_1.png

I test a simple project use the debug mode to have try , it can work well , please see the video and the project.

In the  demo , i first place the function "RedLed()"into 0x75000, at the second download , i delete these this function in mian(),

then download , we can see the data in 0x75000 not changed.

You can also test the simple project first on your side ,if it can now work , please show me the steps and

configurations .

And if you can not connect the board now , please delete the .metadata folder under CW workspace,

then re-open the cw to test again.

Hope it helps


Have a great day,
Alice Yang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
738 次查看
davidzhou
Contributor V

Hi Alice,

For some reason, it didn't work for me.

I posted all the configuration screen saved:

The console output during the start of debug session, it has messages indicating 0x60000 - 0xFFFFF was not erased. It runs and stops at debug break point. But after that it pops up a window and aborts debug session:

pastedImage_1.png

Here is the configurations:

pastedImage_2.png

pastedImage_3.png

pastedImage_4.png

pastedImage_7.png

pastedImage_6.png

I have tried several projects. It downloads, runs, stopped, but ABORTS the debug session (configuration data IS PRESERVED!).

Thank you for your support.

David Zhou

0 项奖励
回复
739 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David,

In the normal mode , do not preserve some range, does it can download successful ?

If not,  please first test a simple project , and do you use the SWD or JTAG debug ? If

SWD, please check it :

pastedImage_1.png

I see you use the K60F120 chip, i also test on it, also use the Multilink Universal FX revB,

it can work well . So i recommend you carefully re-open CW, connect , configure it .

BR

Alice

0 项奖励
回复
738 次查看
davidzhou
Contributor V

Hi Alice,

I found the problem:

pastedImage_1.png

Certainly, that shields some MQX OS debugging capabilities. But it works to preserve some flash memory and still be able to debug.

Thank you,

David Zhou

0 项奖励
回复
738 次查看
davidzhou
Contributor V

Hi Alice,

It works, but I found that it often trigger stack overflow during debug. It maybe come from my own program. One thing I noticed is that it doesn't trigger the stack overflow when running at release mode.

Thank you,

David Zhou

0 项奖励
回复