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.

CC2640R2F: Question about reset sources

Part Number: CC2640R2F


Hello,

I used SysCtrlResetSourceGet() in initialization of my application to see reset source for debugging.

I found that my device is reset sometimes during long term operation.

I checked the occurred reset sources and they were below 5 red colored.

#define RSTSRC_PWR_ON
#define RSTSRC_PIN_RESET
#define RSTSRC_VDDS_LOSS
#define RSTSRC_VDDR_LOSS
#define RSTSRC_CLK_LOSS
#define RSTSRC_SYSRESET
#define RSTSRC_WARMRESET
#define RSTSRC_WAKEUP_FROM_SHUTDOWN
#define RSTSRC_WAKEUP_FROM_TCK_NOISE

Is it reasonable to assume that there is a problem with the power supply or H/W rather than F/W(application or stack code)?

Can it be certain that it's not an F/W issue?

Thanks,

Calvin

  • Hi Calvin,

    Are you powering from battery? Maybe the battery is very low, causing a reset during operation.

    -kel

  • Hello Calvin,

    Most of the reset sources colored are related to hardware, the exception being RSTSRC_SYSRESET which is a software reset.  You can refer to the Driverlib Documentation.

    Regards,
    Ryan

  • Yes, it uses coin battery.

  • Hi Ryan,

    How can I find where the code triggers RSTSRC_SYSRESET without debugger?

    I usually save some errors to nv flash in my application for debugging production.

    Can I catch it that way? And Could it be triggered by Sensor Controller?

    I reset the device with HAL_SYSTEM_RESET() in AssertHandler so I can see RSTSRC_WARMRESET as the reset source if stack assert occurs.

    But it's never occurred until now.

  • Hi Calvin,

    Please review Section 6.7 of the TRM (swcu117) to find that warm resets are converted into system resets.  Therefore it is likely that the AssertHandler is the cause of the RSTSRC_SYSRESET.  You can use print line or LED debugging to further identify the root problem.  I would not suspect the Sensor Controller to trigger the issue at the moment.

    Regards,
    Ryan

  • Hi Ryan,

    As I mentioned, when I use HAL_SYSTEM_RESET() in AssertHandler and call the AssertHandler manually just for test, the reset source captured as RSTSRC_WARMRESET after reset.

    Does it mean that warm resets are not converted into system resets? If so, how to enable it?

  • As I mentioned, when I use HAL_SYSTEM_RESET() in AssertHandler and call the AssertHandler manually just for test, the reset source captured as RSTSRC_WARMRESET after reset.

    That is very unusual. I have tested the HAL_SYSTEM_RESET() and the reset source is RSTSRC_SYSRESET. 

    The Watchdog Reset causes a RSTSRC_WARMRESET.

    -kel

  • A note from Section 6.7.2 of the TRM reads: Because warm reset does not reset the analog parts of the device, such as the radio, doing a warm reset will put the device in a partly unknown state. It is therefore strongly recommended to enable Warm Reset Converted to System Reset feature as described in the section above.  Triggering a warm reset run-time can lead to problems such as unexpected behaviour or program freeze. The only situation where it is ok to not enable Warm Reset Converted to System Reset is during development and debugging if a SW problem is triggering a warm reset. In that situation, not enabling the warm to cold reset feature is typically required to identify the reset source

    Regards,
    Ryan

  • Hi Markel,

    I don't use watch dog in my application.

  • Hi Ryan,

    My question is how to enable Warm Reset Converted to System Reset feature? I can't find details from the doc.

    Here is my AssertHandler code. HAL_SYSTEM_RESET() called last in the function.

    For example, when I execute AssertHandler(HAL_ASSERT_CAUSE_HARDWARE_ERROR,0); just for test in my application,

    my device reset by HAL_SYSTEM_RESET() and the reset reason captured as RSTSRC_WARMRESET.

    The result is same when I use below code instead of the HAL_SYSTEM_RESET();

    HWREG( AON_SYSCTL_BASE + AON_SYSCTL_O_RESETCTL ) |= AON_SYSCTL_RESETCTL_SYSRESET_M;

    Also same with SysCtrlSystemReset();

    void AssertHandler(uint8 assertCause, uint8 assertSubcause)
    {
        #if defined(UART_DEBUG_MESSAGE)
        Uart_printf(">>>STACK ASSERT: Cause[0x%x], Subcause[0x%x]", assertCause, assertSubcause);
        #endif
    
    	nvDebugInfo.stackAssertCause = assertCause;
    	nvDebugInfo.stackAssertSubCause = assertSubcause;
    	osal_snv_write(NVID_DEBUG_INFO, sizeof(nvDebugInfo), &nvDebugInfo);
    
        // check the assert cause
        switch (assertCause)
        {
            case HAL_ASSERT_CAUSE_OUT_OF_MEMORY:
                #if defined(UART_DEBUG_MESSAGE)
                Uart_printf(">>> OUT OF MEMORY!");
                #endif
            break;
    
            case HAL_ASSERT_CAUSE_INTERNAL_ERROR:
            // check the subcause
            if (assertSubcause == HAL_ASSERT_SUBCAUSE_FW_INERNAL_ERROR)
            {
                #if defined(UART_DEBUG_MESSAGE)
                Uart_printf(">>> INTERNAL FW ERROR!");
                #endif
            }
            else
            {
                #if defined(UART_DEBUG_MESSAGE)
                Uart_printf(">>> INTERNAL ERROR!");
                #endif
            }
            break;
    
            case HAL_ASSERT_CAUSE_ICALL_ABORT:
                #if defined(UART_DEBUG_MESSAGE)
                Uart_printf(">>> ICALL ABORT!");
                #endif
            //HAL_ASSERT_SPINLOCK;
            break;
    
            case HAL_ASSERT_CAUSE_ICALL_TIMEOUT:
                #if defined(UART_DEBUG_MESSAGE)
                Uart_printf(">>> ICALL TIMEOUT!");
                #endif
            //HAL_ASSERT_SPINLOCK;
            break;
    
            case HAL_ASSERT_CAUSE_WRONG_API_CALL:
                #if defined(UART_DEBUG_MESSAGE)
                Uart_printf(">>> WRONG API CALL!");
                #endif
            //HAL_ASSERT_SPINLOCK;
            break;
    
            default:
                #if defined(UART_DEBUG_MESSAGE)
                Uart_printf(">>> DEFAULT SPINLOCK!");
                #endif
            //HAL_ASSERT_SPINLOCK;
            break;
        }
    
    	#if 1//!defined(UART_DEBUG_MESSAGE)
    	Task_sleep(1000000/10);
    	HAL_SYSTEM_RESET();
    	#endif
    
        return;
    }

  • I don't use watch dog in my application.

    If you do not have a watchdog implemented and you are getting a WARM RESET as reset cause, that is not normal. As far as I know and what is written in the documentation only the watchdog reset causes a WARM RESET. The WARM Reset you need to convert to system reset.

    -kel

  • Section 6.8.2.4.37 provides the WARMRESET Register information from which details regarding the WR_TO_PINRESET can be ascertained.  At any rate, are you able to locate your reset reason inside the firmware?

    Regards,
    Ryan

  • Hi Ryan and Markel,

    I'm sorry it was my absurd mistake.

    It is right comes RSTSRC_SYSRESET after HAL_SYSTEM_RESET.