csec_keyconfig_s32k148 example run error

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

csec_keyconfig_s32k148 example run error

1,012 Views
zhigang
Contributor I

Hi all,

    I run csec_keyconfig_s32k148 example to test csec nvm key.First I run csec_keyconfig_s32k148 example in flash with jlink,but it reports STATUS_SEC_KEY_UPDATE_ERROR when run CSEC_DRV_LoadKey function.Then, I build the code in ram, and want to repart FlexNVM and FlexRAM, but when I run FLASH_DRV_EraseAllBlock(&flashSSDConfig);, it reports FSTAT->ACCERR error. My SOSC clock is 16000000Hz, and I have reconfig the clock setting in ProcessorExpert.pe. and SPLL div set /2. I don't know why it reports this error.

0 Kudos
3 Replies

1,005 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Please take a look at the SDK documentation

danielmartynek_0-1610707651120.png

danielmartynek_1-1610707716571.png

The example must be run from SRAM first to partition the MCU for CSEc.

And once it has been partitioned, the MCU cannot be mass erased until the keys are removed.

Since you can't mass erase the MCU, I assume it has been partitioned, please run the example with ERASE_ALL_KEYS = 1.

After that, you should be able to mass erase and partition the MCU again.

 

Regards,

Daniel

0 Kudos

993 Views
zhigang
Contributor I

Hi Daniel,

    I call eraseKeys before erase all Flash blocks use PEmicro.

 

if (flashSSDConfig.EEESize == 0)
{
#if ERASE_ALL_KEYS
if (eraseKeys())
{
PINS_DRV_SetPins(GPIO_PORT, 1 << LED_RED);
PINS_DRV_SetPins(GPIO_PORT, 1 << LED_GREEN);
}
#endif

 

Then,I can't debug the code with PEmicro.It reports bus error.I have no io pin to indicate if it success. Then I run example from flash, It still reports CSEC_KEY_UPDATE_ERROR, when I call 

 

stat = CSEC_DRV_LoadKey(CSEC_MASTER_ECU, m1, m2, m3, m4, m5);

 

Can I use PEmicro to watch if it runs example successfully?

0 Kudos

982 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

You can step the eraseKeys() function and the whole example to see which operation fails.

Also, please make sure that the application is indeed in SRAM by reading the program counter.

Thank you,

BR, Daniel

0 Kudos