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
fig2
Solved! Go to Solution.
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:
Regards,
Lukas
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:
Regards,
Lukas
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
fig2
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:
Regards,
Lukas
thank you very much.
According to your help, we made an improved interrupt handler and solved the problem.