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.

LAUNCHXL-CC2650: Watchdog callback function not being called

Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: CC2650, CC2640

Hello all,

I am using Launchxl-CC2650.

BLE SDK 2_02_07_06

TI RTOS 2.21.1.08

CCS7.4

Compiler TI Ver.5.2.6.

I have added code for watchdog driver in  UART_ECHO example code.

I can see that uart prints on serial port successfully.

CC2650 also restarts when the watchdog timer expires.

I am writing to uart port in watchdog callback function, but this function is not being called.

Please help

Thank you,

Dnyaneshvar Salve

  • Hi D,

    Have you checked what intNum is being used by the hwAttrs struct for the watchdog module? I want to ensure that the correct interrupt number is registered for the watchdog driver

    Best,
    Achyut Ray

  • Hi,

    code is changed as shown below.

    const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CC2650_LAUNCHXL_WATCHDOGCOUNT] = {
        {
            .baseAddr = WDT_BASE,
    //        .intNum = INT_WDT_IRQ,//INT_NMI_FAULT
            .intNum = INT_NMI_FAULT,
            .reloadValue = 1000 /* Reload value in milliseconds */
        },
    };

    Now,

    WDT callback function is called but only when debugger is attached.

    When I disconnect the debugger, CC2650 does not call WDT callback function

    (I am toggling LED inside WDT callback function)

    Dnyaneshvar

  • HI a,

    I cant attach debugger just for watchdog to work in my product.

    Please give suggest some solution on this problem

  • Hi again,

    Great to hear that you were able to get the callback! I have the following questions:

    - When you say that the Callback does not occur, do you have a way of knowing what is happening on the device?
    - Does your Callback only toggle a led, and nothing else?
    - Did you do a rebuild of the project between flashing with the debugger connected and without?
    - Lastly, could you tell me where in your code you are changing the hwAttrs struct from?

  • - When you say that the Callback does not occur, do you have a way of knowing what is happening on the device? - Yes, In callback LED is toggled


    - Does your Callback only toggle a led, and nothing else? LED is toggled only


    - Did you do a rebuild of the project between flashing with the debugger connected and without? - I tried both ways, I disconnected the debugger, did clean, rebuild - Flash code

    Then I tried, I kept debugger connected then clean, rebuild -Flash code.

    Both the times,

    if I connect the power to pcb device toggled LED sometimes successfully, but if I power cycle it fails sometimes.

    Yes IT IS CALLING CALLBACK WITHOUT DEBUGGER CONNECTED ALSO, BUT NOT EVERY TIME IF i POWER CYCLE THE PCB.


    - Lastly, could you tell me where in your code you are changing the hwAttrs struct from? - It is in "CC2650_LAUNCHXL.c" file

    We have some devices sent for field test and facing issues which I can solve with Watchdog, so I must add watchdog code to my devices for uninterrupted functioning.

    This tread is not solved from last 23 days,  request you to please give solution as soon as possible

    regards,

    Dnyaneshvar Salve 

  • Hi Dnyaneshvar,

    I would like you to do the following two things:
    - In the Watchdog callback, add the Watchdog_clear() in the interrupt handler, as the first line inside the callback function, if not already done.
    - Turn on Warm Reset Converted to System Reset feature. By default, on the CC2650 device, if the watchdog resets the device, then this is called a Warm Reset. According to the technical reference manual, this can potentially put the device in an unknown state. It is therefore, highly recommended to convert Warm Resets to System Resets. To do this, write the WR_TO_PINRESET bit in the WARMRESET register to 1. An example of how to do this is included in the ble_sdk_2_02_07_06/src/examples/util/bim_extflash/cc2640/bim_main.c file in line 416

    This tread is not solved from last 23 days,  request you to please give solution as soon as possible

    Regarding this, it is not as though I am trying to withhold the solution from you Dnyaneshvar, I am trying to resolve this issue asap too. I thank you for your patience and co-operation with this issue.

    Best,
    Achyut Ray

  • In the Watchdog callback, add the Watchdog_clear() in the interrupt handler, as the first line inside the callback function, if not already done -

    This already done.

    An example of how to do this is included in the ble_sdk_2_02_07_06/src/examples/util/bim_extflash/cc2640/bim_main.c file in line 416 -

    This is done as shown.

    This has also not caused any benefit.

    regards,

    Dnyaneshvar

  • Hi,

    Do you still have debug stall enabled for the watchdog in the code? Having the debugger connected during code execution can affect the timing/behavior of code, which might explain why you see different behavior. Is there any pattern to how the callbacks are called/missed? Or do you notice that the system ends up in a fault?

    Regards,
    Achyut Ray

  • Do you still have debug stall enabled for the watchdog in the code?  - debug stall enable and disabled, Both conditions are checked, It does not make any difference when testing without debugger

    Is there any pattern to how the callbacks are called/missed?  - This is random

    Sorry for the typo

    Regards,

    Dnyaneshvar

  • Hi again,

    How often does this happen? You said you were running the watchdog in the Uart Echo example, do you notice anything strange on the serial terminal? Or is it only the callback being missed?

    Best,
    Achyut Ray