Tool/software:
Dear TI Team,
I am currently facing an issue with displaying the system reset reason on the terminal in my project.
I have implemented the following code to read the RESETCTL register and check for MCU reset reasons:
#ifdef MCU_RESET_REASON
// Read the RESETCTL register
resetctl_value = HWREG(AON_PMCTL_BASE + AON_PMCTL_O_RESETCTL); // check for MCU reset reason
check_reset_source(resetctl_value);
#endif /* MCU_RESET_REASON */
In the check_reset_source
function, I have defined various reset conditions. However, I’ve noticed that the reset reasons appear the same for software resets and when a watchdog trigger shows "Brown Out Detect" on VDDS, rather than displaying only the relevant one. Below is a portion of my check_reset_source
implementation:
void check_reset_source(uint32_t resetctl_value)
{// bit positions for various reset sources /* 0h = Power on reset 1h = Reset pin ,2h = Brown out detect on VDDS, 4h = Brown out detect on VDDR, 5h = SCLK_LF, SCLK_MF or SCLK_HF clock loss detect, 6h = Software reset via SYSRESET or hardware power management timeout detection. Note: The hardware power management timeout circuit is always enabled. 7h = Software reset via PRCM warm reset request */
if (resetctl_value & POR_RST) {
strcpy(resetMessageBuffer, "POR_RST\r\n");
// Logging...
}
else if (resetctl_value & RST) {
strcpy(resetMessageBuffer, "RST\r\n");
// Logging...}
// Additional reset checks...
else {
strcpy(resetMessageBuffer, "Ukn_RST\r\n");
// Logging...
}}
Below are the project details.
- Microcontroller: CC2651R3
- SDK: simplelink_cc13xx_cc26xx_sdk_7_41_00_17
- CCS Version: CCS12.7
- Base Code: Project Zero
Could you please provide guidance on how to modify the check_reset_source
function to ensure that only the correct reset reason is logged and displayed?
Thank You
Regards,
Aarohi Shirbavikar