This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具与软件:
您好!
我正在尝试使用 FlashApi 覆盖在 OTP 扇区0中编程的 AJSM 密钥。 我确保与先前编程的密钥相比、新的128位密钥只会将位从1翻转为0。
启用 OTP 编程并发出编程命令后、FSMSTAT 寄存器的位14设置为1、对应于 ILA"非法地址"。 有没有我忘记考虑的副作用?
以下是我当前使用闪存 API 的代码:
#include <F021.h> #define AJSM_KEY_LEN 16u ///< The length of the AJSM key in bytes #define AJSM_KEY_ADDRESS (0xF0000000u) bool write_ajsm_key(const uint8_t ajsm_key[AJSM_KEY_LEN]) { const uint8_t unlockOtpBank0 = 1u; Fapi_StatusType fret = Fapi_enableBanksForOtpWrite(unlockOtpBank0); if ((fret != Fapi_Status_Success) || (FAPI_GET_FSM_STATUS != 0)) { return false; } fret = Fapi_issueProgrammingCommand((uint32_t*)AJSM_KEY_ADDRESS, ajsm_key, AJSM_KEY_LEN, NULL, 0u, Fapi_AutoEccGeneration); while (FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy) { ; } if ((fret != Fapi_Status_Success) || (FAPI_GET_FSM_STATUS != 0)) { Fapi_disableBanksForOtpWrite(); return false; } Fapi_disableBanksForOtpWrite(); Fapi_FlashStatusWordType fsw; return Fapi_doVerifyByByte((uint8_t*)AJSM_KEY_ADDRESS, AJSM_KEY_LEN, ajsm_key, &fsw) == Fapi_Status_Success; }
感谢你的帮助。
Br、Aaron
大家好、Aaron:
您是否 有机会参考此 pdf:
e2e.ti.com/.../0250.Hercules_5F00_AJSM_5F00_Lock_5F00_Unlock.pdf
——
感谢和回顾、
Jagadish。
尊敬的 Jagadish:
是的、我将本演示用作所有 AJSM 相关任务的参考。
在这里、我想我的问题来自 FlashApi 的使用(因此、我使用了参考指南 SPNU501H 和 TRM SPNU499C 作为参考)。 我上面发布的代码似乎有时起作用,但我不设法找到为什么它失败在其他尝试。 在对 OTP 进行写入之前、我是否还需要在闪存 API 中设置其他位?
背景简述:我希望在引导加载程序中实现这个 AJSM 锁定功能。 但是、如果这不能可靠地工作、我将转而使用 UNIFLASH 将 AJSM 密钥写入 OTP。
此致、Aaron