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.

RTOS/CC3200SDK: How to do Task_sleep( n ) when using LPDS and middleware from SDK 1.2.0?

Part Number: CC3200SDK
Other Parts Discussed in Thread: CC3200

Tool/software: TI-RTOS

Hello, Friends,

I am having some success in integrating power mode capabilities into my TI-RTOS project on cc3200, using the middleware from SDK 1.2.0.  I am finding, however, that Task_sleep( n ) and Event_pend( ) with a timeout value no longer work as expected: the timeout for all practical purposes becomes FOREVER.  It seems obvious to me that the TI-RTOS ticks stop when the device is in LPDS mode, and this is probably what I want to have happen in order to save power.

My question is whether any of you have devised a programming / system idiom to use for Task_sleep and Event_pend with a timeout that cooperates with LPDS, and yet consumes a minimum of excess power? 

One solution that may be obvious is to allow the system tick to wake the device, but that could mean waking every millisecond, which seems a bit excessive for my timeouts which are on the order of 100's or 1000's of ms.

Kind regards,

Kemeron

  • Hi Kemeron,

    A few first questions:

    What version of TI-RTOS are you using?

    Can you describe how your app is going to LPDS?  Are you letting the Power driver’s policy activate LPDS, or are you doing this explicitly in your app?

    The timeout mechanisms for both Event_pend() and Semaphore_pend() are identical.  Behind these APIs a kernel Clock object is created with the specified timeout.  The Power policy I mentioned will look at the active timeouts registered in the Clock module and optionally choose LPDS, or a lesser power saving state, depending on a few criteria, including the amount of time until the next scheduled wakeup.  In all cases, the device should wake when the *_pend() calls timeout, and there should not be a wait forever.

    Can you please also attach the TI-RTOS board file that you are using (probably named CC3200_LAUNCHXL.c).

    Thanks,
    Scott

  • Hi, Scott,

    Thanks for your reply.

    I am using the middleware framework in the cc3200 SDK 1.2.0 to manage power modes, as recommended in this thread: e2e.ti.com/.../563145.

    For testing purposes, I am working with the idle_profile example project from the SDK, configured to use TI-RTOS. The middleware framework appears to want to use 2.15.0.17.

    To demonstrate task sleeping, I insert a little endless loop in one of the tasks, calling osi_Sleep(3000) and printing a few characters to the uart. When the cc3200 is configured to enter LPDS as much as possible, the osi_Sleep() "never" comes back -- that is, not for several minutes. If I instead program some activity that keeps the cc3200 awake for a couple of seconds at a time, then the osi_Sleep() will expire and do the print to uart, though it seems to be counting only awake time rather than real time.

    This experimentation leads me to believe that the ticker that osi_Sleep() uses shuts off during LPDS, hence my o.p. questions regarding preferred idiom.

    Does this thread belong in the WiFi cc3200 forum instead, since it's maybe more to do with how middleware is implemented?

    thanks,
    Cameron
  • Hi Cameron,

    OK, thanks for clarifying.  Yes, if you are using the earlier power framework in middleware these questions are best handled on the CC3200 forum.  I’ll ask that this thread be moved there…

    If you move to the TI-RTOS power management framework this “TI-RTOS” forum is the correct place for any questions.

    Regards,
    Scott