MC56F8367 - Check for internal flash corruption

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MC56F8367 - Check for internal flash corruption

483 次查看
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 项奖励
2 回复数

436 次查看
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 项奖励

422 次查看
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 项奖励