MPC5744P, C55 Flash Driver, Flash Erase Error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5744P, C55 Flash Driver, Flash Erase Error

968件の閲覧回数
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 件の賞賛
返信
4 返答(返信)

940件の閲覧回数
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 件の賞賛
返信

923件の閲覧回数
ChenBowen
Contributor II

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

0 件の賞賛
返信

832件の閲覧回数
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 件の賞賛
返信

926件の閲覧回数
ChenBowen
Contributor II

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

0 件の賞賛
返信