CSEc can not load key repeat

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

CSEc can not load key repeat

ソリューションへジャンプ
1,064件の閲覧回数
BigJulie
Contributor II

Hi,

when i debugging CSEc part in S32K146,load master key in master ecu keyslot after initialization CSEc ,the first time the command CMD_LOAD_KEY function return to OK,the second time the command CMD_LOAD_KEY function return to Not OK,i loaded same key in these two time,and then i can not load key success after that.

how can i load key repeatedly? the function in the below.

FUNC(Crypto_Cse_ErrorCodeType, CRYPTO_CODE) Crypto_Cse_LoadKey(VAR(Crypto_Cse_KeyIdType, AUTOMATIC) keyId, P2CONST(uint8, AUTOMATIC, CRYPTO_APPL_CONST) keyM1Ptr,
P2CONST(uint8, AUTOMATIC, CRYPTO_APPL_CONST) keyM2Ptr, P2CONST(uint8, AUTOMATIC, CRYPTO_APPL_CONST) keyM3Ptr
)
{
VAR(Crypto_Cse_ErrorCodeType, AUTOMATIC) eOutResponse = CRYPTO_CSE_ERC_GENERAL_ERROR;

Crypto_Cse_eState = CRYPTO_CSE_BUSY;

/* clear ACCERR and FPVIOL flags before entering any operation */
Crypto_Cse_ClearErrorFlags();
/* write keyM1Ptr, keyM2Ptr, keyM3Ptr to CRYPTO_CSE_PRAM */
Crypto_Cse_WritePagesToPRAM(keyM1Ptr, CRYPTO_PRAM_PAGE1_ADDR32, CRYPTO_M1_SIZE_IN_PAGES_U16);
Crypto_Cse_WritePagesToPRAM(keyM2Ptr, CRYPTO_PRAM_PAGE2_ADDR32, CRYPTO_M2_SIZE_IN_PAGES_U16);
Crypto_Cse_WritePagesToPRAM(keyM3Ptr, CRYPTO_PRAM_PAGE4_ADDR32, CRYPTO_M3_SIZE_IN_PAGES_U16);

/* write command header to CRYPTO_CSE_PRAM, wait for the completion of the command, read and process error code */
eOutResponse = Crypto_Cse_SendCommand(CRYPTO_CSE_CMD_LOAD_KEY, CRYPTO_CSE_FUNC_FORMAT_COPY, CRYPTO_CSE_CALL_SEQ_FIRST, keyId);
eOutResponse = Crypto_Cse_WaitCommandComplete();

Crypto_Cse_eState = CRYPTO_CSE_IDLE;

return eOutResponse;
}

タグ(2)
0 件の賞賛
返信
1 解決策
1,035件の閲覧回数
namnguyenviet
NXP Employee
NXP Employee

Hello @BigJulie ,

As my understanding, it's not possible to load the same key into CSEc PRAM. Either load another key, or erase the old key and load again is possible.

Best Regards,

Nam

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,036件の閲覧回数
namnguyenviet
NXP Employee
NXP Employee

Hello @BigJulie ,

As my understanding, it's not possible to load the same key into CSEc PRAM. Either load another key, or erase the old key and load again is possible.

Best Regards,

Nam

0 件の賞賛
返信