S32K148 EVB with secure boot cannot be connected

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K148 EVB with secure boot cannot be connected

4,313件の閲覧回数
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.

タグ(2)
0 件の賞賛
返信
10 返答(返信)

3,359件の閲覧回数
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 件の賞賛
返信

4,078件の閲覧回数
hkaracali
Contributor II

Hello Everyone,

Is there any progress about this issue?

Best regards.

0 件の賞賛
返信

4,111件の閲覧回数
turgaykale
Contributor III

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

0 件の賞賛
返信

4,244件の閲覧回数
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 件の賞賛
返信

4,226件の閲覧回数
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 件の賞賛
返信

4,199件の閲覧回数
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 件の賞賛
返信

4,164件の閲覧回数
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 件の賞賛
返信

4,128件の閲覧回数
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 件の賞賛
返信

4,303件の閲覧回数
hkaracali
Contributor II

Hello,

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

4,264件の閲覧回数
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 件の賞賛
返信