XET256 Flash protect and security problem

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

XET256 Flash protect and security problem

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

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