CSEc MASTER ECU KEY update error

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

CSEc MASTER ECU KEY update error

跳至解决方案
2,538 次查看
leandro_malara_
Contributor I

Hi,

I am using CSEc peripheral on S32K144 MCU and an error occurs sporadically when configuring the MASTER ECU KEY (90% of the time works fine):

  • When configuring first time the MASTER_ECU_KEY, CSEC returns ERC_KEY_UPDATE_ERROR. It also appears that using the MASTER_ECU_KEY for updating other keys, returns ERC_KEY_EMPTY, so it seems that the key is actually not configured. What i found out is that the FlexRAM is corrupted: at startup it is sometimes entirely filled with "junk" data, or sometimes goes back to all 1s. So the question is, could it be that an error during FLASH partitioning command (e.g. power loss) caused a FlexRAM error, that in turn resulted in CSEc driver being unable to correctly function?
  • After this error, i am unable to revert back to factory state: no mass erase is possible and CMD_DEBUG_AUTH returns ERC_GENERAL_ERROR when

Also, when partitioning the flash for CSEc usage, but without configuring the MASTER_ECU_KEY, i am unable to revert to factory state:

  • Mass erase is not working, as if keys were configured
  • Executing CMD_DEBUG_CHAL and CMD_DEBUG_AUTH, returns ERC_GENERAL_ERROR. I use MASTER_ECU_KEY equal to all 1s. Is there a default value to use for MASTER_ECU_KEY that is not all 1s? or is it not possible to erase keys and flash partition without first configuring a MASTER_ECU_KEY?

Thank you. Kind regards,

Leandro Malara.

 

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

Hi,
If MASTER_ECU_KEY is not programmed, it is not possible to reset the device back to factory state. The key is either loaded or the slot is considered as empty. There’s no default key value. Yes, it’s equal to all 1s but it’s not considered as default and valid key. This behavior is required by SHE specification.
Once CSE is enabled by partitioning, the only way to destroy the partition is to run CMD_DEBUG_CHAL and CMD_DEBUG_AUTH with knowledge of the MASTER_ECU_KEY. There’s no workaround for that.
Such sporadic problem should not happen. That means something obviously went wrong during previous steps. Unexpected reset/power-down during partitioning could also be the reason. Or are you sure you are not operating the device out of specification? In production, the partitioning is supposed to be done only once per lifetime of the device. It should be done in factory under controlled conditions, so such situation cannot happen.
I’m not really sure what’s the root cause of your troubles. Can you see that on one device only? Or is more of them affected?
Regards,
Lukas

在原帖中查看解决方案

5 回复数
662 次查看
Hua_Xue
Contributor I

Hello, I met the exactly same problem as you did. Have you found the root cause and solved the problem yet? 

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

Hi,
If MASTER_ECU_KEY is not programmed, it is not possible to reset the device back to factory state. The key is either loaded or the slot is considered as empty. There’s no default key value. Yes, it’s equal to all 1s but it’s not considered as default and valid key. This behavior is required by SHE specification.
Once CSE is enabled by partitioning, the only way to destroy the partition is to run CMD_DEBUG_CHAL and CMD_DEBUG_AUTH with knowledge of the MASTER_ECU_KEY. There’s no workaround for that.
Such sporadic problem should not happen. That means something obviously went wrong during previous steps. Unexpected reset/power-down during partitioning could also be the reason. Or are you sure you are not operating the device out of specification? In production, the partitioning is supposed to be done only once per lifetime of the device. It should be done in factory under controlled conditions, so such situation cannot happen.
I’m not really sure what’s the root cause of your troubles. Can you see that on one device only? Or is more of them affected?
Regards,
Lukas

1,988 次查看
luyu
Contributor I

Hello

      I‘m engineer from China Aptiv. And also I meet the same issue as the customer did.

      But I still don't know how to fix this issue.

      Could you give me some advice for it?

0 项奖励
回复
657 次查看
Hua_Xue
Contributor I

Hello, I met the exactly same problem as you did. Have you found the root cause and solved the problem yet? 

0 项奖励
回复
2,519 次查看
leandro_malara_
Contributor I

Hi,

Thank you for your feedback. It happened on two ECUthat I use during development. As you mentioned, during production the partition is done once and under controlled conditions, and until now no problems occurred in production ECUs but just during development.

0 项奖励
回复