Backdoorkey verify not working in S32K142

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Backdoorkey verify not working in S32K142

Jump to solution
1,029 Views
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 Kudos
Reply
1 Solution
1,011 Views
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

View solution in original post

0 Kudos
Reply
2 Replies
1,012 Views
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 Kudos
Reply
984 Views
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 Kudos
Reply