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.

CC3220MODA: SoC freezes on rebooting when it invokes method PRCMMCUReset()

Part Number: CC3220MODA
Other Parts Discussed in Thread: CC3220SF

Hi,

I have got a problem with software rebooting of CC3220MODASF12MONR SOC.

The SoC freezes very often on rebooting if I do it when the SoC is connected to a WiFi network. The freeze means FW doesn’t start initialization in main() method when I invoke method PRCMMCUReset(true);.

And I’ve found that if I set up Access Point mode before rebooting, it could reboot stable. There is the code I use before rebooting to get stable reboot:

   void Cc3220sf::reboot()

   {

                   portDISABLE_INTERRUPTS();      

unsigned char s[] = {0x0};

//disable internal rom pages

sl_NetAppSet(SL_NETAPP_HTTP_SERVER_ID, SL_NETAPP_HTTP_ROM_PAGES_ACCESS, sizeof(s), (const unsigned char *)s);

sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_STOP, 0, 0, NULL, (uint32_t)NULL);

sl_WlanSetMode(ROLE_AP);

sl_Stop(0);

RTOS::Thread::sleep_ms(1000);

sl_Start(NULL, NULL, NULL);

RTOS::Thread::sleep_ms(1500);

                   sl_Stop(0);                    

                   PRCMMCUReset(true);

   }

It looks like SoC stores some information about WiFi communication in co-processor and something goes wrong if it starts when station mode was set last time.

Could you explain to me the correct universal sequence of deinitialization which I need to do before rebooting if SoC is either in station mode or AP mode?

And also could any hardware components: capacitor, resistor influent on soft rebooting of SoC?

Andrey

  • Please try to use sl_Stop with a timeout (e.g. 200ms) before doing the PRCMMCUReset.

    Br,

    Kobi

  • Hi Kobi,

    I've applied your recommendation. But anyway I've got SoC freezing on reboot, maybe a bit rarer.

    There are some details about our application:

    We use our own board based on CC3220MODASF12MONR SOC

    Target application based on OS FreeRTOS 10.2.1

    We use service pack sp_3.13.0.3_2.0.0.0_2.2.0.6.bin 

    simplelink c32xx SDK - 3_20_00_06

    Host platform:

    Windows OS.

    IAR compiler

    You can see below my changes in reboot method:

    void reboot()
    {
        portDISABLE_INTERRUPTS();
        sl_NetAppSet(SL_NETAPP_HTTP_SERVER_ID, SL_NETAPP_HTTP_ROM_PAGES_ACCESS, sizeof(s), (const unsigned char *)s);
        sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_STOP, 0, 0, NULL, (uint32_t)NULL);
        sl_WlanSetMode(ROLE_AP);
        sl_Stop(200);
        RTOS::Thread::sleep_ms(1000);
        sl_Start(NULL, NULL, NULL);
        RTOS::Thread::sleep_ms(1500);

        sl_Stop(200);

        PRCMMCUReset(true);
    }

  • Hi,

    My recommendation is to use this restart code.

    PRCMHibernateIntervalSet(330);
    PRCMHibernateWakeupSourceEnable(PRCM_HIB_SLOW_CLK_CTR);
    PRCMHibernateEnter();

    In case you not expect any problem with SimpleLink driver, you should call sl_Stop(200); before reboot code as well.

    BTW ... it is very bad practice do not read return codes from sl_ API calls. I suppose that main reason of your issue is that you not read return codes and your code suffers to unhandled bugs.

    Jan

  • Jan,

    thank you for your comments!

    It looks it has resolved the issue. I mean using PRCMHibernateEnter() instead PRCMMCUReset method.

    Regarding your comments about return code processing: I use reboot() method as a reaction of processing on fails in main application. As an example:

         if(sl_Start(NULL, NULL, NULL) != ROLE_STA) {

             reboot();

         }

    
    

    So I do the processing. Exactly inside reboot() method, I'm not doing it because I don't know what to do else if I've got any else error code because I'm in progress of rebooting already.

    Now I have only one else question:
    is it necessary to invoke sl_stop() before PRCMHibernateEnter() if sl_Start(..) was failed?
    I mean is the method sl_stop() safe in that case? could it hang in such situation?

  • Hi,

    It is hard to answer your questions.

    > is it necessary to invoke sl_stop() before PRCMHibernateEnter() if sl_Start(..) was failed?

    Is is a good practice to call sl_Stop() before using PRCMHibernateEnter(). Especially when you have opened user files for writing using filesystem API. But...

    I mean is the method sl_stop() safe in that case? could it hang in such situation?

    Unfortunately it depends on type of error. According my experiences it can sl_Stop() hang in case of something wrong is happens with SimpleLink driver which is running at host. As I know SimpleLink drive is pretty stable piece of code, but your other code can ruin your day.

    Jan

  • BTW. although you are expecting a return code of ROLE_STA, the sl_Start may return other return codes that can be handled by the application without immediately performing an MCU reset. Please refer to http://www.ti.com/lit/ug/swru455j/swru455j.pdf for details.

    Br,

    Kobi

  • Ok Thank you.
    There are no more questions for now.