[Security] CSEC component invoke the eraseKeys interface problem

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

[Security] CSEC component invoke the eraseKeys interface problem

Jump to solution
333 Views
Gideon
Contributor III

Dear NXPs:

        S32K146;

        S32DS sample 《csec_keyconfig_s32k146》

        NXP NVM has written the key. First burn the Clear Key project. After calling the bool eraseKeys(void) interface in csec_utils.c, the key is successfully erased. Burn the KeyLoad project again. Under IAR Debug, hardFault occurs in the first run. Reset (the greenbox is the IAR Debug reset button) and execute again. Key is written successfully. (Two projects are designed, one Clear key and one load key. When using them, it is found that after the Clear key project is running, the loadkey project is burned again. It is found that the loadkey project is not executed. IAR Debug finds that it has entered hardFault. The participation of IAR Debug is only a temporary solution). I need your help, please

Gideon_0-1720059096084.png

 

0 Kudos
Reply
1 Solution
292 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Gideon 

lukaszadrapa_0-1720601480488.png

 

Isn't just an additional reset needed? That's the only probable root cause I can see.

Regards,

Lukas

View solution in original post

0 Kudos
Reply
2 Replies
293 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Gideon 

lukaszadrapa_0-1720601480488.png

 

Isn't just an additional reset needed? That's the only probable root cause I can see.

Regards,

Lukas

0 Kudos
Reply
264 Views
Gideon
Contributor III
@lukaszadrapa
Thank you for your strong support.I called the following function and found that it still didn't work.
void SystemSoftwareReset(void)
{
uint32_t regValue;

/* Read Application Interrupt and Reset Control Register */
regValue = S32_SCB->AIRCR;

/* Clear register key */
regValue &= ~( S32_SCB_AIRCR_VECTKEY_MASK);

/* Configure System reset request bit and Register Key */
regValue |= S32_SCB_AIRCR_VECTKEY(FEATURE_SCB_VECTKEY);
regValue |= S32_SCB_AIRCR_SYSRESETREQ(0x1u);

/* Write computed register value */
S32_SCB->AIRCR = regValue;
}
0 Kudos
Reply