XET256 Flash protect and security problem

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

XET256 Flash protect and security problem

804 次查看
lognight
Contributor III

I have set the flash configuration to protect high address 4K range and no security,

     static const UINT8 NV_PROTECT_INIT @0xFF0C = 0xCF;

     static const UINT8 NVFSEC_INIT @0xFF0F = 0xFE;

but after download program into mcu, i found the mcu enter security status, BDM debug was not available.

I wrote a program to read the value from address at 0xFF0C and 0xFF0F, and the register FPROT and FSEC, and send out those 4 values, here was the 4 values:

0xFF0C  FPROT    0xFF0F  FSEC

0xCF      0x7F         0xFE     0xFF.

I'm very confused about this, what happened to mcu?

标签 (1)
0 项奖励
回复
1 回复

614 次查看
kef2
Senior Contributor V

Try looking for FLASH NOUNSECURE

S12(X) MCU Security

The problem is that flash on S12XE is ECC protected, you can't write more bits without erase, else ECC check fails. Since CW on every download writes NVSEC with 0xFE, no matter do you specify it in your code or not, ECC for this flash phrase at 0xFF00-0xFF07 fails and MCU automatically engages security. NOUNSECURE will make CW not writing security bits, unless you specify them in your code.

0 项奖励
回复