mpc5744p flash erase

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

mpc5744p flash erase

跳至解决方案
1,894 次查看
XSL-WF
Contributor I

Problem Description: as shown in Figure 2, call the erase function to erase. Each single step of the for loop can erase 64K or 256K. However, if there is no problem with erasing 64K, it will fly away when the first 256K block is erased and 0xFFFFFFFF is written in the first picture! At present, the problem is located in the code area in Figure 1. How to solve it?

fig1

XSLWF_0-1647393676018.png

fig2

XSLWF_1-1647393690800.png

 

 

0 项奖励
回复
1 解答
1,872 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Are all interrupts disabled before erase?

Most likely, this event should trigger Machine Check exception. Is there a handler for this exception in your project? It could help to find the root cause:

lukaszadrapa_0-1647520760344.png

Regards,

Lukas

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,884 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

most likely, this is caused by Read While Write (RWW) error. Notice that RWW is supported only  between partitions. When you erase/program a partition, the code must be executed from another partition or from RAM:

lukaszadrapa_0-1647425259079.png

Regards,

Lukas

0 项奖励
回复
1,879 次查看
XSL-WF
Contributor I
hi,
tks for your anwer.

At present, the erasure code is in RAM. When the code calling the erasure program is placed in the first 64K area(fig1), there are still two areas that cannot be erased(fig2). Once erased, it will run away. When you put all the code in the first 64K area, there is no problem.

fig1

XSLWF_1-1647482439185.png

fig2

XSLWF_0-1647482074970.png

 

标记 (1)
0 项奖励
回复
1,873 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Are all interrupts disabled before erase?

Most likely, this event should trigger Machine Check exception. Is there a handler for this exception in your project? It could help to find the root cause:

lukaszadrapa_0-1647520760344.png

Regards,

Lukas

0 项奖励
回复
1,861 次查看
XSL-WF
Contributor I

thank you very much.

According to your help, we made an improved interrupt handler and solved the problem.

0 项奖励
回复