MPC5602P Data Flash programming with CodeWarrior

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

MPC5602P Data Flash programming with CodeWarrior

跳至解决方案
1,652 次查看
clemNantes
Contributor I

Hello Everyone,

 

I'm building an app with MPC5602P and I need to store some information into dataFlash (Addr : 0x00800000) when programming device.

 

I've create a new section in .LCF file and putting my data into this section

after compilation data is correctly set in the S-RECCORD file :

96759_96759.pngpastedImage_0.png

But when I'm trying to debug App the same segment seem to be not programming in Codewarrior debug view :

96760_96760.pngpastedImage_1.png

 

It look like debugger doesn't program DataFlash, Is anybody have an idea about this problem?

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,394 次查看
stanish
NXP Employee
NXP Employee

Hi Clement,

Debug button programs just the code flash by default.

Anyway you can create a Flash script (called Target Task) and execute it each time your debug session starts:

1) Open Target Task view

pastedImage_0.png

2) Add a new Target Task and name it e.g. "MPC5602_dflash"; select "Active Debug Context" as a Run Config.; select Task Type " Flash Programmer for Power Architecture"

pastedImage_1.png

3) Add a device - MPC5602P_DATA_FLASH

pastedImage_3.png

4) Adjust Base Address to 0x00800000, Target RAM address = 0x40000000; Size = 0x3000; add Program/Verify Action

pastedImage_5.png

5) Select generated .elf file from your workspace project, enable "Erase sectors before program" and enter "Restrict to Address in this Range" Start = 0x00800000, End 0x0080FFFF

pastedImage_6.png

6) Check that flash action is present in the list of actions

pastedImage_8.png

7) Now Enter Debug Configuration and add a task to execute:

pastedImage_11.png

8) Select Target Task - the one you just created (MPC5602P_dflash)

pastedImage_13.png

9) the task should appear in the list of tasks to execute when code is downloaded into target:

pastedImage_14.png

10) press apply and debug - this time your Data flash should be programmed

Similarly you can program e.g. shadow flash.

Hope it helps.

Stan

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,394 次查看
clemNantes
Contributor I

Hello Stanislav,

Sorry i'm late to answer but your solution work well!!

Thanks a lot

0 项奖励
回复
1,395 次查看
stanish
NXP Employee
NXP Employee

Hi Clement,

Debug button programs just the code flash by default.

Anyway you can create a Flash script (called Target Task) and execute it each time your debug session starts:

1) Open Target Task view

pastedImage_0.png

2) Add a new Target Task and name it e.g. "MPC5602_dflash"; select "Active Debug Context" as a Run Config.; select Task Type " Flash Programmer for Power Architecture"

pastedImage_1.png

3) Add a device - MPC5602P_DATA_FLASH

pastedImage_3.png

4) Adjust Base Address to 0x00800000, Target RAM address = 0x40000000; Size = 0x3000; add Program/Verify Action

pastedImage_5.png

5) Select generated .elf file from your workspace project, enable "Erase sectors before program" and enter "Restrict to Address in this Range" Start = 0x00800000, End 0x0080FFFF

pastedImage_6.png

6) Check that flash action is present in the list of actions

pastedImage_8.png

7) Now Enter Debug Configuration and add a task to execute:

pastedImage_11.png

8) Select Target Task - the one you just created (MPC5602P_dflash)

pastedImage_13.png

9) the task should appear in the list of tasks to execute when code is downloaded into target:

pastedImage_14.png

10) press apply and debug - this time your Data flash should be programmed

Similarly you can program e.g. shadow flash.

Hope it helps.

Stan

0 项奖励
回复