Hello,
I worked on S32K148 EVB for a project and after upload an example code that named csec_keyconfig_s32k148 to understand the CSEc secure boot. It was uploaded successfully. However, I cannot have any connection to the board from Pemicro debugger or openSDA. It is blocked. I looked for some similiar issues but I do not understand them and cannot solve this problem. Is there anyone who describe the procedure to reset to factory state/save the board?
Thanks.
Hi, I have tried to use csec_keyconfig_s32k148 example code but it is giving some errors can you please guide which Version of S32 DS IDE you are using?
Hello Everyone,
Is there any progress about this issue?
Best regards.
Friends, is there any update on the title for the solution?
Hi,
Important point is that once the CSE is enabled, mass erase cannot be executed. To be able to mass erase the flash, it’s necessary to reset the chip back to factory state using CMD_DBG_CHAL and CMD_DBG_AUTH commands. For this operation, you need to know MASTER_ECU_KEY.
There are following reasons why the chip is (or seems to be) bricked:
- if your debugger uses mass erase when loading new project to flash, it won’t work due to reasons described above. Some debuggers erase individual blocks instead of performing mass erase, so this works. But you should be still able to establish the connection via JTAG/SWD and you should be able to load a project to RAM memory.
- if you enabled strict sequential boot mode and the flash content does not corresponds to calculated CMAC. In this case, the chip will never leave reset state and it cannot be recovered.
So, my recommendation is to check if the reset signal is asserted all the time and if you are able to enter debug mode via JTAG/SWD.
To destroy the partition / disable CSE, you can use project 5_Resetting_flash_to_the_factory_state from AN5401:
https://www.nxp.com/webapp/Download?colCode=AN5401&location=null
https://www.nxp.com/webapp/Download?colCode=AN5401SW&location=null
Notice that it needs to be executed from RAM and it is necessary to update your MASTER_ECU_KEY in file CSEc_functions.c, function DBG_AUTH. Change this as needed and run the project:
uint32_t MASTER_ECU_KEY_VALUE[4] = {0xD275F12C, 0xA863A7B5, 0xF933DF92, 0x6498FB4D};
Then mass erase should work and it should be possible to load new project to the flash.
Regards,
Lukas
Hi @lukaszadrapa ,
Thank you for your detailed explanations. The problem is going to be solved by this method. However, the example project 5 was created for S32K144, I cannot convert it to S32K148 properly. Can you explain it how?
Thanks.
Hi,
Hello @lukaszadrapa again,
Hi @lukaszadrapa again,
Is there any progress on this issue, because this issue still maintains its importance and urgency for me.
Best Regards.
Hello,
I have faced same problem before but I cannot find any solution. Is there anyone who knows the solution?
Hello,
I run csec_keyconfig_s32k148 example on the S32K148 EVB. However I cannot connect or reprogram EVB via OpenSDA or Multilink debugger. How can I solve this issue?
Best reagrds.