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.

CC3235MODASF: Best practice with error during initialization

Part Number: CC3235MODASF

Hi,

We have a few devices using cc3220 and cc3235 with TI-RTOS. It happens very infrequently that somes devices lose communication and drain the battery for a while. Usually after a reset they are back online without issue.

I am trying to find the issue and to remove all possible cause of such problems. And I have seen that in the example on which I based my program there are a few "while(1)" when init fails.

For example: 

    retc = pthread_create(&thread, &pAttrs, mainThread, NULL);
    if(retc != 0)
    {
        /* pthread_create() failed */
        while(1)
        {
            ;
        }
    }

What is the best practice when a failure happens in this initialization phase?

Can I simply call PRCMHibernateCycleTrigger()? 

And can it be done before BIOS_start() and sl_start()?

Thanks!

Cédric

  • Hi Cedric,

    Are you seeing issues on the pthread_create() for the mainThread? I think it's surprising that you might see that happen...

    The best way to handle a software reset will be to use the Power_shutdown() function call if you are using TI-Drivers. Internally this uses MAP_PRCMHibernateEnter() function along with some other functions to set a known state for the device before resetting. This should be able to be used independent of BIOS_start(). Both Power_shutdown() and the driverlib PRCM_ functions are technically independent of sl_Start, but it would be recommended to make sure the network processor is off (with sl_Stop()) prior to resetting the system when possible.

    Best Regards,

    Ben M

  • Hi Ben,

    For now we have no idea why the devices get stuck. We have seen it on about  ~1% of our devices per year (with a little extrapolation), and have not been able to reproduce it.

    I'm just trying to remove all possible cause for this issue, and while(1) look like an obvious one even if unlikely. I have made other changes as well.

    I'll use Power_shutdown() then. Sl_stop shall not be needed as all those initialization steps are before sl_start.

    Thanks!

    Cédric