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.

CC3220: WatchDog did not trigger

Part Number: CC3220

My cc3220 board work as bridge between server (using TCP sockets) and cc1310 (using UART).

I used WatchDog to auto-reboot cc3220 then it's do not get packets from server for a 30 minutes. All (including WatchDog) works fine for a 5 months on 30 boards.

Yesterday 2 of my boards (from different manufacturers with several different components) completely hangs after RebootMCU() function call. WatchDog did not reboot cc3220 after > 24 hours. Even RESET pin did not reboot device (only power cycle). 

Why it's can happen?

void RebootMCU()
{
    UART_PRINT("Try sl_Stop \n\r");

    _i16 result = sl_Stop(200);

    if (result != 0)
    {
        UART_PRINT("sl_Stop result: %d\n\r", result);
        sl_Stop(0);
    }

    UART_PRINT("RebootMCU() \n\r");

    PRCMHibernateCycleTrigger();
}

  • Rustem,

    I'm a little confused by your explanation. You say you use the watch-dog timer to reboot the CC3220 but in RebootMCU function you call
    PRCMHibernateCycleTrigger which puts the device into hibernate mode and uses the RTC to wake up. In other words, if the device is in hibernate mode, the watch-dog timer is off and you are relying on the RTC to wake-up. Have you verified the RTC is working on the 2 devices you are having issues with? If the RTC is good you could also try verifying if the wake-up sources are actually getting triggered when the latched value match the RTC.

    Jesu
  • Hello! Thank you for a quick answer!
    I do not know the exact string of RebootMCU() function where hang is happen. May be PRCMHibernateCycleTrigger() did not called.
    RTC works fine, i've checked. Anyway, it's does not explain no reboot by RESET pin.
  • Hi,

    What SOP mode do you use? In case of SOP mode 010 used, you should check that UART RX line in not at low state.

    Jan
  • I use SOP 000
  • Hi,

    I did not realize this thread had a response, apologies. Are you still having the same issue? If not I will close thread. If you have a new question create a new thread.

    Jesu
  • Hello!
    I still waiting for the answer.
    And i had the same issue on CC3220LP
  • Hi,

    Could you try stepping through the reboot function to see if you get stuck before entering hibernate and report back your findings?

    Also a small concern of mine is your error checking for sl_Stop. If sl_Stop returns an error (result < 0), you shouldn't ignore that and call sl_Stop again. I recommend you check what your errors are and handle them gracefully to make sure they don't persist after reset. Also, a safer way to check if sl_Stop returns an error is to check for (result < 0) instead of (result != 0).

    On a side note, there is a caveats to the WDT where even on a watchdog reset the NWP does not entirely reset. More info in TRM section 10.4.

    www.ti.com/.../swru465.pdf

    Jesu

  • Hey,

    Apparently section 10.4 does not apply to the CC3220 parts so disregard it. My mistake.

    Jesu
  • Hello! Thank you for the answer!
    This issue appears very rare, i can not catch it using debugger.
    In my previous project i tried to call sl_Stop() in cycle until it returns >=0, but sometimes (rare) it's never returns >= 0 and device hangs. According to SimpleLink documentation, if i call sl_Stop(0) - device will not hang, it's just loses some packets.
  • Hi,

    Try adding the prcm.c file in your project from the driverlib folder in your SDK installation so you can step through the PRCMHibernateCycleTrigger function. You do not have to move it from the SDK just copy the same file into your project directory.

    You should not call sl_Stop a second time if it fails the first time. You should check what the error is and fix it.

    Jesu
  • Hello!
    As i said, This issue appears very rare, i can not catch it using debugger.
    Then it's happens, device is already in hang state and i can not attach debugger.

    The purpose of Reset in my situation is to handle unexpected error. If i can fix it - i do not need Reset.
    So:
    1. May be you can give me command, that will reset cc3220 with 100% chance of success?
    2. Why cc3220 can hang and not reboot even by RESET pin?
  • Hi Rustem,

    A 100% reset guarantee would be setting the nRESET pin, it's very weird that is not working for you. What is the voltage and duration of the pulse your measuring when attempting to reset via nRESET?

    Jesu
  • Hi Jesu,

    One quick comment. It seems that this issue looks similar like this with CC3200 - e2e.ti.com/.../2679938

    Jan
  • Hello!

    I tried different duration: 0.5 sec, 1 sec, 2 sec. Voltage is around 0V. But board (my custom board and LP) did not reboots. 

    Anyway, i need to reboot board by program command, not using external components.

  • I have the related question: How can i store result returned sl_stop() in persistent memory? After next bootup i can transfer this result to server and will have more information to debug this problem.
  • Hi,

    Answer to your last question is this. In case of NWP is stopped by the sl_Stop() API, you cannot use filesystem APIs to save data into external flash (sFlash) memory. You have following options:
    - in case of CC3220SF device you can store data into internal XIP flash. But XIP flash was not intended for this purpose, from this reasons is not available example in SDK for this use case. You can use some end addresses of the XIP for this purpose. Information how to implement writing into XIP flash you find at TRM ( www.ti.com/.../swru465 chapter 21 ) and driverlib in SDK ( \source\ti\devices\cc32xx\driverlib\flash.c/h ).
    - store return code into another device (another memory connected to CC3220, processor, etc.)

    There may to be other ways how store values which persist MCU restart, but I think that are not related to your use case:
    - create separate section in RAM, and store value there. Data in RAM will survive reset of application processor, but not survive power cycle of restart of whole CC3220 SoC by PRCM API.
    - save values into retention registers (2×32-bit) in hibernate controller. But this is not related to your use case, because you need to use RTC for SoC restart. Content of retention registers does not survive power supply cycle.

    Jan
  • Hello!

    I found the reason of reset fault:

    Device hangs in PRCMHibernateCycleTrigger(), after line:

      // Request hibernate.

      PRCMHIBRegWrite((HIB3P3_BASE+HIB3P3_O_MEM_HIB_REQ),0x1);

    This happens then UART packet comes until PRCMHibernateCycleTrigger() is executing. 

    Then i stop thread, which processes UART packets, when call UART_close(), when disable all PIN interrupts, and only after this call  PRCMHibernateCycleTrigger()  - device do not hangs and i got successful Reset.

    But this is not a solution. If PRCMHibernateCycleTrigger() can hang because of UART it can hang because  of other unknown reasons. What is the way to Reboot cc3220 with 100% chance of success?

    I tried powerShutdown(), but it also hangs like a PRCMHibernateCycleTrigger().

  • Hello,

    Before entering hibernate you should close all peripheral instances you have running. Our power management core prevents the MCU from entering hibernate if there is for example a UART packet coming in. You can see the power dependency being set in the UART_open implementation which you can find in source file.

    Jesu
  • Hello!
    1. In this case, why MCU not entering hibernate after receiving UART packet?

    2. I think, it's must be documented. I see only one requirement for PRCMHibernateCycleTrigger() - "call sl_stop()"

    3. What is the full list of steps to safe reboot cc3220? Call sl_stop(), close peripherals, what else?

  • Hello,

    Please verify if when you call the PRCMHibernateCycleTrigger function does you get a JTAG disconnect prompt in the CCS console window. If possible share a screenshot of the console log in your response.

    Let me know.

    Jesu

  • Hello!
    Yes, i got disconnect message from debugger
  • Hello,

    To make sure we are on the same page. If your debugger disconnects that means you entered hibernate mode - it's not a hang.

    Jesu
  • Hello!
    Device completely stops working, led not blinking, device have not any life signs. May be it's in hibernate mode, but it's fails to reboot.
    Please, tell me:
    3. What is the full list of steps to safe reboot cc3220? Call sl_stop(), close peripherals, what else?
  • Hello,

    Your reboot function is correct. It would be safer to close peripherals if the power manages is interacting with them like I showed you earlier - but ultimately it shouldn't matter.

    If your debugger disconnects when you enter the reboot function that means you entered hibernate mode. If device does not reboot you should investigate your wake up sources.

    Jesu
  • Hello!
    How can i investigate wake up sources? As i know, in my case i need only one wake up source - clock. And it’s work correct
  • Hello,

    Since you are just using RTC to wake up there's not much to investigate apart from ensuring correct circuit and measuring the clock signal but you need to be careful when probing oscillators. If you do not have the proper equipment and knowledge for measuring oscillators I do not recommend it. 

    Try using these driverlib calls instead of PRCMHibernateCycleTrigger that sets up the power manager to wakeup from hibernate every 5 seconds. I just tested it and it worked consistently.

    // RTC clk as HIB wakeup source
    PRCMHibernateWakeupSourceEnable(PRCM_HIB_SLOW_CLK_CTR);
    
    // set HIB interval to 5 seconds
    PRCMHibernateIntervalSet(32768 * 5);
    
    // enter HIB mode
    PRCMHibernateEnter();

    If it works for you, compare register writes to the reboot function you're using to find the discrepancy or go into the PRCMHibernateCycleTrigger implementation and extend the wakup time to 5 seconds to see if that works too. Let me know what happens.

    Jesu

  • Hello!
    To do this, i need to solder wires to LaunchPad. I use RTC for many operations in my program and all of them work fine. I also tried to run program on 2 LP and 3 of my devices with same result. I do not think, that we have a chance, that all of oscillators are broken.
  • Hello,

    Since your are using RTC for other operations in your program and it's working as expected no need to verify the circuit.

    Jesu