S32K148 EVB with secure boot cannot be connected

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

S32K148 EVB with secure boot cannot be connected

4,796 Views
nevozade
Contributor IV

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.

Tags (2)
0 Kudos
Reply
10 Replies

3,842 Views
baseerahmadpiracha
Contributor III

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?

0 Kudos
Reply

4,561 Views
hkaracali
Contributor II

Hello Everyone,

Is there any progress about this issue?

Best regards.

0 Kudos
Reply

4,594 Views
turgaykale
Contributor III

Friends, is there any update on the title for the solution?

0 Kudos
Reply

4,727 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

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

 

0 Kudos
Reply

4,709 Views
nevozade
Contributor IV

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.

0 Kudos
Reply

4,682 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

In case you have different derivative than S32K144, you can simply create new project for S32K148 and copy following files to your new project:
 
main.c
CSEc_functions.c
CSEc_functions.h
CSEc_keys.h
CSEc_macros.h
 
Also don't forget to change:
#include "S32K144.h"
to
#include "S32K148.h"
in those files.
 
This is much easier than trying to reconfigure original project to different derivative.
 
Regards,
Lukas

0 Kudos
Reply

4,647 Views
nevozade
Contributor IV

Hello @lukaszadrapa  again, 

I want  to give details about the situation. Now, I created a new S32K148 project 'named as unblocker' and copied the specified files from example reset flash to factory state project, then it was built successfully. However, I tried to load this 'unblocker' project both openSDA and Multilink, but it did not work, so I think that I am missing something about the MASTER_ECU_KEY_VALUE. It's like I can't access the board at all, let alone checking the key. I attached some figures. Two of them represent the keys which were uploaded with the csec_keyconfig_s32k148 example project from csec_utils.c. One of them refers the MASTER_ECU_KEY_VALUE to unblock the board from 'unblocker' project (CSEc_functions.c). The last one shows the error window while connecting. Moreover, the project which blocked our board after uploading (csec_keyconfig_s32k148) is attached as used before. Briefly, by looking these keys that entered, may you say to me what I am doing wrong to unblock the board? Please, it is urgent.
 
Best Regards.
0 Kudos
Reply

4,611 Views
nevozade
Contributor IV

Hi @lukaszadrapa again,

Is there any progress on this issue, because this issue still maintains its importance and urgency for me.

Best Regards.

0 Kudos
Reply

4,786 Views
hkaracali
Contributor II

Hello,

I have faced same problem before but I cannot find any solution. Is there anyone who knows the solution?

4,747 Views
hkaracali
Contributor II

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.

0 Kudos
Reply