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.

RTOS/CC2640R2F: BLE comms can't be reestablished after watchdog timer reset.

Part Number: CC2640R2F


Tool/software: TI-RTOS

We've observed that BLE comms can't be reestablished after watchdog timer reset. Based on the reset cause register, the watchdog timer issues the wrong type of reset (WARM reset, as opposed to SYSTEM_RESET, which is documented unstable.) We tried to work-around it by detecting the WARM reset and then issuing a subsequent SYSTEM_RESET, but this sometimes fails.

 Another option we were considering is to use the GP Timer, but when we attempt to register the interrupt handler it creates a strange linker error in IAR. Hoping that you might suggest some additional insight or sample code that could allow us to move forward with a robust watchdog timer solution. Currently the best we can do is a SWI timer (which does not seem very robust.) 

NOTE we are currently using the follow tools and API versions:

  • simplelink_cc2640r2_sdk_1_35_00_33
  • IAR

  • Hi,

    Following this post:
    e2e.ti.com/.../622890

    Warm reset is intended behavior. Given the note provided, TI strongly recommends enabling the Warm Reset Converted to System Reset feature.
    Please review Section 6.7.2.

    The note in section 6.7.2 describes your issue as well "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."

    www.ti.com/.../swcu117h.pdf

    More posts that will be helpful for implementing/providing more clarity:
    e2e.ti.com/.../2297424
    e2e.ti.com/.../2466486
  • Hi,

    We tried two approaches but we were not able to establish the BLE link after the reset.

    1. Called the HAL_SYSTEM_RESET() in the watchdog call back routine

    2. Set the bit #2 of WARMRESET register to change from warm reset to pin reset

    #define REG_WDT_PIN_RESET HWREG(WDT_BASE + PRCM_WARMRESET_WR_TO_PINRESET)
    static void _wdt_pin_reset_enable() {
    uint32_t val = REG_WDT_PIN_RESET | PRCM_WARMRESET_WR_TO_PINRESET_M;
    REG_WDT_PIN_RESET = val;
    }
    static void watchdogCallback(uintptr_t unused)
    {
    /* Clear watchdog interrupt flag */
    Watchdog_clear(watchdogHandle);
    }
    static void _watchdog_init(void){
    Watchdog_Params params;
    Watchdog_init();
    _wdt_pin_reset_enable();
    params.callbackFxn = (Watchdog_Callback)watchdogCallback;
    params.resetMode = Watchdog_RESET_ON;
    Watchdog_Params_init(&params);
    watchdogHandle = Watchdog_open(0, &params);
    Watchdog_setReload(watchdogHandle, Watchdog_convertMsToTicks(watchdogHandle,120000));
    }
  • Please see updated post from Vishal Shrivastava.
  • Hi Vishal,

    Can you provide some more details on the state of the device after the reset? Where exactly does it fail when you try to connect?

    Regards,
    Fredrik

  • Hi Vishal,

    Do you have an update on this or can I close this thread?

    Cheers,
    Fredrik