MPC5744P, C55 Flash Driver, Flash Erase Error

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

MPC5744P, C55 Flash Driver, Flash Erase Error

970 Views
ChenBowen
Contributor II

Dear expert:

      I am doing MPC5744P Bootloader Project. I arrange low flash memory block2 , low flash memory block3  and high flash memory block 0 for bootloader . And the other flash memory blocks,starting from high flash memory block 1,  for application.  So , all the other high flash memory blocks need to be erased

      However,  when executing the Flash erase function, the kernel encounters an exception and the program stops.  

   In code, I set  highBlockSelect = 0b111110;    If I modify it,  highBlockSelect = 0b000000,  only erase the 256K flash blocks,  no problem occurs.    How to explain this phenomenon?

 

    

0 Kudos
Reply
4 Replies

942 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @ChenBowen 

See Table 5-4. in the reference manual. Here is beginning of the table:

lukaszadrapa_0-1688059590197.png

Each flash block belongs to certain RWW (Read While Write) partition.

 

lukaszadrapa_0-1688059939018.png

Or in other words, when program or erase operation is running on a partition, the code must run from another partition or from RAM.

If the code already runs from another partition or from RAM, it may be caused by interrupts when  interrupt handler accesses that partition. In this case, it's necessary to either disable interrupts or make sure that it does not touch that partition.

Regards,

Lukas

 

 

 

0 Kudos
Reply

925 Views
ChenBowen
Contributor II

How to make sure the interrupt handler does not touch that partition?

0 Kudos
Reply

834 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

The interrupt handler needs to be placed to different partition and it should not call a function / it should not read a data which are placed in partition which is currently being modified by flash operation.

Regards,

Lukas

0 Kudos
Reply

928 Views
ChenBowen
Contributor II

    Thank you for your reply ! The code runs from another partition , but the flash erase function is called in interrupts. 

0 Kudos
Reply