MC56F8367 - Check for internal flash corruption

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

MC56F8367 - Check for internal flash corruption

697 Views
SGatDGI
Contributor I

Hello,

I am using MC56F8367 DSC. I need to protect the data sector of the internal flash memory. And keep a check if the data sector of the flash does not become 'All Ones'.

In the code, I have mostly covered most of the protection related points mentioned in the user manual - such as loading the " RDARY1 " command, setting the FMPROT to 1 and checking for the  " BLANK " and the "SECSTAT" bit. To test this implementation, I erase the data sector of the flash and then using the debugger, I see that the "SECSTAT" and "BLANK" bits still remain 0. 

Is there any application note or example code dedicated to check on flash corruption that I can refer to ?

 

Thank You !

0 Kudos
Reply
2 Replies

650 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

For the MC56F83xx, there is configuration field in program flash, this is a special flash space, it's data will be copied to flash registers automatically.

Pls refer to section 6.4 Memory Map in the MC56F8300um.pdf.

 

xiangjun_rong_0-1699262759232.png

I suggest you do not test the configuration field page.

After erasing, the flash data should be 0xFFFF.

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply

636 Views
SGatDGI
Contributor I

Hi,

Yes. After erasing if I manually read each byte of the particular flash data sector, I read them all as ONE ( 65535).

However, when I check if PVIOL  == 1 or FMSECL == 0xE70A or FMSECH.bit.SECSTAT == 1 or FMUSTAT.bit.BLANK == 1 , I see that these conditions are not met. Even when I have the Flash protection turned ON using FMPROT = 1 before erasing that sector.

 

Thanks !

0 Kudos
Reply