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.

CC3200: System dead-lock after a WD reset, problem with hibernate reset getting stuck.

Part Number: CC3200

Hi,

Is the problem with cc3200 device locking up fixed?

I have devices locking up on me after OTA , Specifically in a noisy environment with a low RSSI.

If OTA does not complete successfully , most of the time the processor locks up and watchdog is triggered. The system Reboots , the code detects the WD Boot, and tries to perform what has

been suggested, Go through Hibernate, But the Problem is, the Hibernate reset does not happen and device is locked again, until watchdog is triggered again. This continues on for ever until a cold reboot by unplugging the device .

       ->  reboot  -> stuck in hibernate reset -> WD trigger   |

        ^------------------------------------------------------------------<--

It seems as if what ever caused the WLAN to initially stop the processor, does it again when trying to hibernate.

HERE is the code for when WD reset is detected and trying to initiate a hibernate based reset.

case PRCM_WDT_RESET:

//force NWP to idle State

HWREG(0x400F70B8) = 0x1;
UtilsDelay(800000/5);

//Clear the interrupt
HWREG(0x400F70B0) = 0x1;
UtilsDelay(800000/5);

//reset NWP, WLAN domains
HWREG(0x4402E16C) |= 0x2;
UtilsDelay(800);

//Wnsure ANA DCDC is moved to PFM mode before envoking hibernate
HWREG(0x4402F024) &= 0xF7FFFFFF;

HIBEntrePreamble();
MAP_PRCMOCRRegisterWrite(0,1);
PRCMHibernateWakeupSourceEnable(PRCM_HIB_SLOW_CLK_CTR);
MAP_UtilsDelay(8000000);
//! Set wake up time and enter HIB
//!
PRCMHibernateIntervalSet(330);
PRCMHibernateEnter();

break;

Regards

Ahmad

  • Hi Ahmad,

    Your reset code looks correct. Are you using FreeRTOS?

    Jesu

  • Hi Jesu ,

    Yes, I am. 

    One correction to the reset code I shared. It does not contain the call HIBEntrePreamble(); 

    As I was making changes to make things work, and request for Help I had that line added to my code, from search references. But that function is unresolved and does not exist under my environment. Unfortunately I posted for help before compiling. that line was removed right after the post. sorry for incorrect data there.

    Problem still persists, 

    As I mentioned , I see this issue more often, when my Application OTA Fails, Sometime after that (undetermined) processor hangs and causes the WD Trigger.

    Keep in mind I have seen cases of WD Trigger that result into correct reset handling and the system continues without any problem. But Every Once in a while, the dead-lock Issue happens., where hibernate does not reset the system.

    Thanks

    Ahmad

  • Hi Jesu,
    I added sl_stop on my WD reset detection path. I dont know if it makes sense or not but things seem to be running OK now.

    sl_Stop(0);
    //force NWP to idle State
    HWREG(0x400F70B8) = 0x1;
    UtilsDelay(800000/5);

    //Clear the interrupt
    HWREG(0x400F70B0) = 0x1;
    UtilsDelay(800000/5);
  • Hi Ahmad,

    The only thing I can comment is that when going into hibernate mode the WDT turns off so I find it weird that when you are starting the hibernate process your WDT gives you problems. Anyway, glad you fixed your problem.

    Feel free to create a new thread if you have a new question.

    Jesu
  • Hello everyone,

    I'm also having problems with CC3200 hanging during hibernate. Most of the time it works perfectly, but sometimes the SoC hangs after a hibernate cycle request and the watchdog does not reset the system!

    Here is the code for our hibernate request:

    /*!
     * \brief Reboot the MCU by requesting hibernate for a short duration.
     * \return None
     */
    void app_utils_hibernate_cycle (bool slstop, bool signal_fatal_error)
    {
    	if (signal_fatal_error)
    	{
    		// Signal fatal error
    		LED_set_sys_flag(LED_sys_flags_fatal_error, true);
    		vTaskDelay(2000 / portTICK_PERIOD_MS);
    		LED_set_sys_flag(LED_sys_flags_off, true);
    	}
    
    	taskDISABLE_INTERRUPTS();
    
    	if (slstop)
    	{
    		sl_Stop(0); // Stop network processing
    	}
    
    	Utils_TriggerHibCycle(); // REBOOT !
    	
    	taskENABLE_INTERRUPTS(); // Should never reach this line
    }
    void Utils_TriggerHibCycle(void)
    {
        //
        // Configure the HIB module RTC wake time
        //
        MAP_PRCMHibernateIntervalSet(330);
    
        //
        // Enable the HIB RTC
        //
        MAP_PRCMHibernateWakeupSourceEnable(PRCM_HIB_SLOW_CLK_CTR);
    
        //
        // Enter HIBernate mode
        //
        MAP_PRCMHibernateEnter();
    }

    Note that we have had problems before where the system hanged during a hibernate request and we assumed that it was because we were getting an UART RX IRQ during the execution of hibernate request routines, so we added a taskDISABLE_INTERRUPTS(); (from FreeRTOS) in order to disable interrupts from hitting during the hibernate request. This seemed to solve the problem back then, but we are experiencing hangs again even after disabling interrupts.

    Jesu, can you please elaborate on the fact that WDT does not work on hibernate? How can we recover from a hang if it happens during hibernate request?

  • Hey Caio,

    I think this might help you:

    e2e.ti.com/.../631872

    Jesu
  • Hi Jesu, I don't think this is our problem.

    The only moment where we experience a hang is when trying to issue a hibernate cycle.

    Also, we don't have a watchdog ISR, we just let it expire twice and reboot the MCU.

    We are now thinking that the problem might be with the call to sl_Stop. The problem goes away if we remove it. I opened a new thread to ask about this: e2e.ti.com/.../2825719

    Thank you.

  • Hi Caio,

    Out of curiosity, try to see if the problem persist if you pass 200 to sl_Stop instead of 0. I've seen issues where in certain cases sl_Stop(0) causes the system to hang. If this fixes your problem please report it in your new thread.

    Thanks for creating a new thread - I will be closing this one.

    Jesu
  • Hi Jesu,

    The issue persists with a timeout of 100 and 200. This is very problematic because not even the WDT can recover from such hangs. We removed sl_Stop altogether and it seems to work perfectly.

    Could anyone from TI confirm if we actually need sl_Stop or not? We assumed it is not necessary since the standard routine for recovering from a WDT reset (which only resets the MCU and does not reset the NWP) is issuing a hibernate (in order to reset the whole SoC). Can you confirm?

    Thank you.

    Caio
  • Hi Caio,

    /**** please disregard this ****/
    An sl_Stop will shutdown the NWP just as an MCU hibernate will. I don't believe it's necessary.

    EDIT:

    What I meant to say is that if you trigger an MCU hibernate the NWP will also go into hibernate. However, it is always safer to call sl_Stop() first to gracefully put the NWP into hibernate.


    Jesu

  • Hi Caio,

    I made an edit to my last response. Please review it.

    Jesu
  • Hi Jesu, after some more testing, we decided to remove the call to sl_Stop. We left 10 devices continuously rebooting every 15 minutes for a couple of days and had no issues. The systems starts promptly and instantly reconnects to the WiFi network. Then we increased the reboot periodicity to 6 hours and no issued were found during the 6 hours after rebooting.

    Thank you,

    Caio.
  • Hi Caio,

    One of our team members are already assisting on this matter here:
    e2e.ti.com/.../2831353

    Please direct your questions to that thread.

    Jesu