When using Csec module, the key failed to be loaded, please help to see what the problem is

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

When using Csec module, the key failed to be loaded, please help to see what the problem is

跳至解决方案
2,154 次查看
ZEROOO
Contributor IV

Hi

    When I use Csec module, I fail to update the loading key. After executing setAuthKey, I directly load the key using loadKey (line 184, line 185). In this case, the loading of the key is successful, and the return value is 1. Call loadKey, and the load will continue to fail, return the value of 0, what is the problem?

ZEROooo_0-1680512083879.png

The following is a case where the loadKey return value is not success when debugging with IC5000.

ZEROooo_1-1680512180100.png

 

 

0 项奖励
回复
1 解答
2,110 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Yes, after loading of MASTER_ECU_KEY by setAuthKey function, you can load or update other keys by loadKey only with correct parameters.

Regards,

Lukas

在原帖中查看解决方案

0 项奖励
回复
5 回复数
2,138 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @ZEROOO 

do you mean that loadkey at line 184 and 185 is working and loadkey at 189 and 196 is not working? If yes, it makes sense because the counters need to be updated.

lukaszadrapa_0-1680627432797.png

But there's also next point - I really do not recommend to mix SDK and AN5401 together. More rework would be necessary in this case. For example, M1-M3 values are calculated inside the loadkey function. The calculate_M1_to_M5 won't have effect here at all.

Regards,

Lukas

 

0 项奖励
回复
2,127 次查看
ZEROOO
Contributor IV

Hi Lukas

    I still don't understand something about the key update. In AN5401, calculate_M1_to_M5 is used to update the key first, which is to obtain the value of M1-M3, so LOAD_KEY is used to load and update the key. This is the idea of AN5401, right? In SDK, firstly, setAuthKey is used to load MASTER_ECU_KEY and set it as authorization Key, and then loadKey is used to update key. Is it because loadKey in SDK already includes M1-M3 calculation? So after setting setAuthKey, you can load updates directly using loadKey? loadKey in SDK only calculates M1-M3, M4-M5 is not needed in the process of updating key, then what is the function of computeM4M5 used for?

AN5401:

ZEROooo_0-1680674247578.png

SDK:

ZEROooo_1-1680674260101.pngZEROooo_2-1680674313146.png

 

0 项奖励
回复
2,123 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @ZEROOO 

LOAD_KEY and loadKey are not the same functions. Just open the functions in SDK example to see what's inside:

lukaszadrapa_0-1680677996920.png

lukaszadrapa_1-1680678004056.png

 Regards,

Lukas

 

 

0 项奖励
回复
2,120 次查看
ZEROOO
Contributor IV

Hi

    I seem to understand how to update the secret key, I can simply think that after setting the authorization secret key, if I use SDK, I can directly complete the update of the secret key through loadKey function, need to pay attention to the parameter Settings, is that right?

0 项奖励
回复
2,111 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Yes, after loading of MASTER_ECU_KEY by setAuthKey function, you can load or update other keys by loadKey only with correct parameters.

Regards,

Lukas

0 项奖励
回复