The cases where the MCU may be locked after the keys are loaded in CSEc

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

The cases where the MCU may be locked after the keys are loaded in CSEc

393件の閲覧回数
icypistol
Contributor I

I'm facing a issue that the MCU is locked after load keys in CSEc. (unlock kinetis tried, but still not worked, as below picture)

What I did were just loaded keys with NXP example project, and then flash my image via SWD.

Now I would like to find out the possibilities where the MCU is locked in my operation. Before that,

Could you give me some feedback regarding my doubts below?

1. The command of Mass Erase will set FSEC[SEC] = 10b(unsecure state), or any other values(secure state)?

2. When I flash a image with the FSEC[SEC] = 10b. Does it means the debugger will firstly erase FSEC[SEC] = 11b, then program FSEC[SEC] = 10b?

3. What's the cases where the FSEC[SEC] will be set as a secure state value? I noticed that when I flash a image, the FSEC[SEC] can be set. How about the case of a power loss during image flashing? Do you know any other cases?

 

icypistol_0-1685780094944.png

 

Thanks.

0 件の賞賛
1 返信

312件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @icypistol,

1.

Yes, the mass erase operation sets the FSEC[SEC] byte in the flash configuration field to the unsecure state.

AN12130 Production Flash Programming Best Practices for S32K1xx MCUs

https://www.nxp.com/docs/en/application-note/AN12130.pdf

danielmartynek_0-1685955731334.png

However, the CSEc keys are allocated, the mass erase is blocked by the engine.

The debugger can erase the flash by sectors.

danielmartynek_1-1685955892202.png

 

2.

That would be a question for the vendor of the debugger.

But there is no need to erase the first sector (0x0000 - 0x1000) if the phrase containing the FSEC in the image matches the value in the flash (FSEC = 0xFE)

 

3.

If the MCU is reset while the first sector is erased (FSEC = 0xFF), the MCU will get locked, and since Mass erase is blocked by CSEc, the MCU will be locked permanently.

Unfortunately, this must be taken into consideration whenever the CSEc is used.

 

Best regards,

Daniel