Backdoorkey verify not working in S32K142

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

Backdoorkey verify not working in S32K142

跳至解决方案
1,030 次查看
ssean
Contributor III

Hello.

Environment : S32K142, IAR 8.22, Multilink Debugger

I want to test backdoorkey verify before enable secure lock.

I set my program like below.

IAR setup

https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-IAR-EWARM-to-program-flash-configuration...

Startup.s

ssean_2-1685069380538.png

ROM file (SREC)

ssean_0-1685069058883.png

Memory Dump in Debugger

ssean_1-1685069068774.png

Verify Code

ssean_3-1685070140615.png

After "launch command", FSTAT = 0xA0.

When I test this solution in another product, that works ok.

--> S32K146, GHS Compiler, Trace32 Debugger

 

Could you give me some advise?

Thank you.

0 项奖励
回复
1 解答
1,012 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

The IAR setup should be correct, as the ROM file (SREC) and Memory Dump in Debugger look correct.

Did you already refer to the example: S32K144 Verify Backdoor Access Key S32DS1.3?  NOTE: The Verify Backdoor key command is executed from RAM to avoid simultaneous access to the PFlash block.

Example_S32K144_Verify_Backdoor_Access_Key_S32DS1.3_v2.jpg

You can also refer to the APIs in S32K1 SDK: FLASH_DRV_SecurityBypass and FLASH_DRV_CommandSequence

FLASH_DRV_SecurityBypass FLASH_DRV_CommandSequence.jpg

According the "Verify Backdoor Access Key command" of S32K-RM, the following may cause FSTAT[ACCERR]:

Verify Backdoor Access Key command.jpg

I want to test backdoorkey verify before enable secure lock.
MassErase (FSEC[MEEN])is able to unsecure the MCU too(Do not enable CSEc until the backdoor is normal). Maybe you can secure the MCU in FlashConfig and check if FSEC[SEC] is unsecured after Verify Backdoor Access Key command.

Best Regards,
Robin

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,013 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

The IAR setup should be correct, as the ROM file (SREC) and Memory Dump in Debugger look correct.

Did you already refer to the example: S32K144 Verify Backdoor Access Key S32DS1.3?  NOTE: The Verify Backdoor key command is executed from RAM to avoid simultaneous access to the PFlash block.

Example_S32K144_Verify_Backdoor_Access_Key_S32DS1.3_v2.jpg

You can also refer to the APIs in S32K1 SDK: FLASH_DRV_SecurityBypass and FLASH_DRV_CommandSequence

FLASH_DRV_SecurityBypass FLASH_DRV_CommandSequence.jpg

According the "Verify Backdoor Access Key command" of S32K-RM, the following may cause FSTAT[ACCERR]:

Verify Backdoor Access Key command.jpg

I want to test backdoorkey verify before enable secure lock.
MassErase (FSEC[MEEN])is able to unsecure the MCU too(Do not enable CSEc until the backdoor is normal). Maybe you can secure the MCU in FlashConfig and check if FSEC[SEC] is unsecured after Verify Backdoor Access Key command.

Best Regards,
Robin

0 项奖励
回复
985 次查看
ssean
Contributor III

Dear @Robin_Shen 

Thank you for reply.

Program run in HSRUN mode, it caused ACCERR bit.

Change to RUN mode, ACCERR bit not set.

 

But after then...

Program falls hard fault exception and jump to reset handler after run below code

FTFC->FSTAT = FTFC_FSTAT_CCIF_MASK;                 // launch command

I'm in waiting for support from FAE in my regions.

 

If you have any advice for me, just let me know.

 

Best Reagrds,

Sean.

 

0 项奖励
回复