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 using PM_framework and Hibernate gets stuck in HIB

Other Parts Discussed in Thread: CC3200MOD

Greetings once again,

As discussed in a previous post I made I am developing a low-power application using the Power Management framework and Hibernate mode on the CC3200MOD processor.

My application is based on the sensor_profile example from SDK 1.1.0. I have added SmartConfig, Factory Reset, NTP sync capabilities as well. Working on OTA as well.

As a wake-up source from Hibernate I have an external RTC unit , button and a sensor , all of which drive the interrupt pin low to in order for the mCU to wake-up. Each is connected to a separate wake-up pin.

The problem is that while the application works fine (I have set RTC to provide a wake-up INT every 2 minutes), after 2-3 iterations the CC3200MOD does not wake-up from Hibernate and I need to reset the unit.

Every time the device wakes up, it reads a configuration file from the SFlash, syncs the external RTC using an NTP server and then it connects to a custom server to transmit data measurements and receive data.

I have checked that the external devices provide the interrupt but the mCU does not seem to recognize it.

I have set the  stack size to 10240 bytes and the OSI stack size to 8192 bytes.

Could you provide some information as to how I can determine the cause of this problem and some pointers on what to try out to correct it ?

Thank you in advance

Pavlos

  • Hi Pavlos,

    Can you try one wake up source at a time? Does the MCU wake up from hibernate using only the RTC as source? Does the hibernate demo work as expected?

    Regards,
    Gigi Joseph.
  • I've tried with one source (only RTC) but the same thing happens.

    The hibernate demo works with the launchpad but I have a custom board and a more complex application , so that may be an issue.

    I am a bit concerned with memory leakage/usage.

    To be more specific.

    Whenever I skip the main part of the application (reporting, ntp sync, etc.) , the device is able to wake-up more times than when actually doing all those stuff.

    What could be the cause of that ? What could I look into ?

    Another thing is that I need to communicate with a server using HTTP and XML, so that means that my code uses a lot of strings/buffers/sprintf.
    Could that affect the reliability of the application ?
  • One more thing I would like to add is that I use 10240 bytes for the system stack and 8192 bytes for the OSI stack.

    Could those large values be the cause of the problem.

    And a little bit more information.

    The external RTC I have communicates with the processor via SPI and I have two other sensors on I2C bus.

    In my application task (the one called every time the processor exits hibernate) ,

    I initialize the I2C and SPI interfaces in the beginning .

    //
    // creating the queue for signalling about connection events
    //
    iRetVal = osi_MsgQCreate(&g_tConnection, NULL, sizeof( unsigned char ), 3);
    if (iRetVal < 0)
    {
    UART_PRINT("unable to create the msg queue\n\r");
    LOOP_FOREVER();
    }
    
    UART_PRINT("In Timer Task - User\n\r");
    
    I2C_Init();
    
    RTC_SPI_INIT();

    Should I deInit the interface before the device goes to hibernate or is this is redundant ?

    Furthermore, I have not included those interfaces in the soc_module struct for the PM framework since I need them only when the device is active and not in Hibernate.

    I really need to solve this issue to be able to deliver the device for testing. If this is a common/known issue I will have to switch to another platform.

  • With a little bit more testing I have found out the following

    If I remove all socket connectivity from the application it works as expected...

    In my TimerGPIOTask I have added the GetSNTPTIme functionality from the ota_update example. Even with this addition the device gets randomly stuck and does not wake-up.

    My OSI_STACK_SIZE is now 8192 bytes.

    What should be the value for the usStackDepth argument of the osi_TaskCreate function ?

    Right now I'm calling it like this.

    iRetVal = osi_TaskCreate(TimerGPIOTask,
    (const signed char *)"set wk_src for hibernate",
    4*OSI_STACK_SIZE, NULL, 1, NULL );

    Any pointers ? A reply on this thread will be greatly appreciated.

  • Pavlos,

    Apologies for the delayed response.

    Few Qs:
    - Do you see this issue just by adding 'GetSNTPTime' in 'TimerGPIOTask' of 'sensor_profile'? Can you share your application? I would want to reproduce the issue on my setup, and hence, I would know details of the test setup and application flow.
    - Why do you need 8K of stack, BTW?
    - Have you enabled OTA in your application?

    Thanks & Regards,
    Praneet
  • In my code I need to communicate to a server using XML and I have quite a few sprintfs.
    Due to the fact that the communication protocol requires a large buffer, I have opted to increase the stack size.

    As I was implementing the communication protocol I found out that the program would not properly start. The issue was resolved after increasing the stack size , so I decided to go for a large stack.

    OTA is not yet enabled in the application. The source files are in the project but no OTA action is taken for the current firmware.

    I have a device using the same communication protocol but PM framework and hibernate are not used. It's a simpler approach since I do not need any power management and it seems to work fine, no errors or hangups.

    I'd be glad to share my application with you, is there a way to do it without posting the entire code here ? (email, etc.)
  • Pavlos,

    If you have a Dropbox account, please copy the contents in there and share w/ praneet.adimulam@ti.com.
    Can you also try running a simpler application (like '/cc3200-sdk/examples/hib') on your custom board and share your observations?

    -/Praneet