mpc5744p flash erase

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mpc5744p flash erase

Jump to solution
2,065 Views
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 Kudos
Reply
1 Solution
2,043 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
2,055 Views
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 Kudos
Reply
2,050 Views
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

 

Tags (1)
0 Kudos
Reply
2,044 Views
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 Kudos
Reply
2,032 Views
XSL-WF
Contributor I

thank you very much.

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

0 Kudos
Reply