工具与软件:
您好!
我正在使用 MSPM0L1306 MCU、并且正在尝试测试 NRST 触发的 BOOTRST。
我在 RSTCAUSE 寄存器中看不到0x0C 值。
如何测试此场景?
如何生成低于条件?
NRST (低电平<1s)
请帮助生成 NRST 触发的 BOOTRST 复位。
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.
工具与软件:
您好!
我正在使用 MSPM0L1306 MCU、并且正在尝试测试 NRST 触发的 BOOTRST。
我在 RSTCAUSE 寄存器中看不到0x0C 值。
如何测试此场景?
如何生成低于条件?
NRST (低电平<1s)
请帮助生成 NRST 触发的 BOOTRST 复位。
尊敬的 Sourabh:
我对延迟答复表示歉意。 您是否在使用 Code Composer Studio?如果是、哪个版本?
假设您在使用 CCS、则可以启动调试会话、使您能够在目标运行时进行连接。 请参阅随附的 PDF 文件、其中说明了步骤。 连接到目标后、执行复位(NRST 至 GND)并查看 RSTCAUSE 寄存器。 我看到0x0C。
如果不使用 CCS、请告诉我。
尊敬的 Sourabh:
好的、正如您从下面的示例中所看到的、这非常简单。 一个 driverlib 函数返回复位原因。 我在代码中设置了一个断点(__BKPT (0))、但对于您的应用程序、您可能会根据返回值执行各种代码。
int main(void) { uint32_t cause; cause = DL_SYSCTL_getResetCause(); __BKPT(0); SYSCFG_DL_init(); while (1) { __WFI(); } } #if 0 //from hw_sysctl_mspm0l11xx_l13xx.h /* SYSCTL_RSTCAUSE Bits */ /* SYSCTL_RSTCAUSE[ID] Bits */ #define SYSCTL_RSTCAUSE_ID_OFS (0) /* !< ID Offset */ #define SYSCTL_RSTCAUSE_ID_MASK ((uint32_t)0x0000001FU) /* !< ID is a read-to-clear field which indicates the lowest level reset cause since the last read. */ #define SYSCTL_RSTCAUSE_ID_NORST ((uint32_t)0x00000000U) /* !< No reset since last read */ #define SYSCTL_RSTCAUSE_ID_PORHWFAIL ((uint32_t)0x00000001U) /* !< POR- violation, SHUTDNSTOREx or PMU trim parity fault */ #define SYSCTL_RSTCAUSE_ID_POREXNRST ((uint32_t)0x00000002U) /* !< NRST triggered POR (>1s hold) */ #define SYSCTL_RSTCAUSE_ID_PORSW ((uint32_t)0x00000003U) /* !< Software triggered POR */ #define SYSCTL_RSTCAUSE_ID_BORSUPPLY ((uint32_t)0x00000004U) /* !< BOR0- violation */ #define SYSCTL_RSTCAUSE_ID_BORWAKESHUTDN ((uint32_t)0x00000005U) /* !< SHUTDOWN mode exit */ #define SYSCTL_RSTCAUSE_ID_BOOTNONPMUPARITY ((uint32_t)0x00000008U) /* !< Non-PMU trim parity fault */ #define SYSCTL_RSTCAUSE_ID_BOOTCLKFAIL ((uint32_t)0x00000009U) /* !< Fatal clock failure */ #define SYSCTL_RSTCAUSE_ID_BOOTEXNRST ((uint32_t)0x0000000CU) /* !< NRST triggered BOOTRST (<1s hold) */ #define SYSCTL_RSTCAUSE_ID_BOOTSW ((uint32_t)0x0000000DU) /* !< Software triggered BOOTRST */ #define SYSCTL_RSTCAUSE_ID_SYSWWDT0 ((uint32_t)0x0000000EU) /* !< WWDT0 violation */ #define SYSCTL_RSTCAUSE_ID_SYSBSLEXIT ((uint32_t)0x00000010U) /* !< BSL exit */ #define SYSCTL_RSTCAUSE_ID_SYSBSLENTRY ((uint32_t)0x00000011U) /* !< BSL entry */ #define SYSCTL_RSTCAUSE_ID_SYSWWDT1 ((uint32_t)0x00000013U) /* !< WWDT1 violation */ #define SYSCTL_RSTCAUSE_ID_SYSFLASHECC ((uint32_t)0x00000014U) /* !< Flash uncorrectable ECC error */ #define SYSCTL_RSTCAUSE_ID_SYSCPULOCK ((uint32_t)0x00000015U) /* !< CPULOCK violation */ #define SYSCTL_RSTCAUSE_ID_SYSDBG ((uint32_t)0x0000001AU) /* !< Debug triggered SYSRST */ #define SYSCTL_RSTCAUSE_ID_SYSSW ((uint32_t)0x0000001BU) /* !< Software triggered SYSRST */ #define SYSCTL_RSTCAUSE_ID_CPUDBG ((uint32_t)0x0000001CU) /* !< Debug triggered CPURST */ #define SYSCTL_RSTCAUSE_ID_CPUSW ((uint32_t)0x0000001DU) /* !< Software triggered CPURST */ // For reference, here is driverlib function to see how it is implemented /** * @brief Return byte that is stored in RSTCAUSE. * * @return The cause of reset. One of @ref DL_SYSCTL_RESET_CAUSE */ __STATIC_INLINE DL_SYSCTL_RESET_CAUSE DL_SYSCTL_getResetCause(void) { uint32_t resetCause = SYSCTL->SOCLOCK.RSTCAUSE & SYSCTL_RSTCAUSE_ID_MASK; return (DL_SYSCTL_RESET_CAUSE)(resetCause); } #endif