请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:AM2634 工具与软件:
您好!
Mcu_Get 042formRawResetReasonImplementation 不正确、请在下面找到所附代码片段:
启动代码会清除复位原因并将其存储在硬件备用寄存器中、但 MCAL API 会读取复位原因寄存器。
您的、
Abdelerhman Afifi
Mcu_RawResetType Mcu_GetPlatformRawResetReason(void) { VAR(Mcu_RawResetType, MCU_VAR) rawResetReason = 0U; Mcu_controlModuleUnlockMMR(0, MCU_TOP_RCM_PARTITION0); /* Get reset reason, stored in WARM_RST_CAUSE by startup code */ rawResetReason = (Mcu_RawResetType)toprcmREG->WARM_RST_CAUSE; HW_SET_FIELD32(toprcmREG->WARM_RST_CAUSE_CLR, TOP_RCM_WARM_RST_CAUSE_CLR_CLEAR, 0x7); Mcu_controlModuleLockMMR(0, MCU_TOP_RCM_PARTITION0); return rawResetReason; } _sysResetCauseHandler_ ; Obtain the reset cause by reading the system reset cause register ldr r6, SYS_RST_CAUSE ldr r6, [r6] ; Check if reset cause has been cleared, skip if so cmp r6, #0 beq EXIT_RST_HNDL ; Store the reset cause in SPARE REG RW0 ldr r5, TOPRCM_SPARE_RW0 ; Store the reset cause value str r6, [r5] ; Clear the System reset cause ldr r5, SYS_RST_CAUSE_CLR mov r4, #0x7U str r4, [r5]
启动代码会清除复位原因并将其存储在硬件备用寄存器中、但 MCAL API 会读取复位原因寄存器。
您的、
Abdelerhman Afifi