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.

task_sleep relative task switch

Other Parts Discussed in Thread: CC1310

Hi Experts,

I am using the CC1310 and using our TI_RTOS.  I've one question regarding the task_sleep:

If I call a task_sleep() in a high priority task TASK_A, when the task_sleep ticks expires, the TASK_A will change from TASK_BLOCKED to TASK_READY, then, if their is also TASK_B in ready state with higher priority than TASK_A, then, TASK_B or TASK_A will be executed first after task_sleep expires?

Thanks!

  • Hi Louis,

    If two tasks are simultaneously in the ready state, the one with the highest priority will run first.

    Regards,
    Scott

  • Hi ScottG,

    one more question regarding the task_sleep, will it inflect the Watchdog function(); if we only have a task, that is TASK_A; we call the task_sleep() in TASK_A, then which state the MCU will enter(I think it's relate to the power management rules, where can I find rules regarding this?) And on what condition, the Watchdog timer may be affected? Thanks!

  • Hi ScottG,

    Sorry, due customer project is quite tight and have concern on this. Appreciate your quick feedback! Thanks.
  • Hi Louis,

    Calling Task_sleep() will block execution of the current task.  Then any other tasks that are ready will run.  When all tasks are blocked the Idle loop will run.  If power management is enabled a power policy will be called from the Idle loop, and it will check different criteria and choose the best/allowed power saving state.  The power concepts and the reference power policy are described in the Power Management User’s Guide in the product installation.  Also here: downloads.ti.com/.../Power_Management.pdf

    Regarding a watchdog… there is no default servicing of a watchdog by the kernel.  If the application is using a watchdog then it must take care of initializing and feeding it.  There are many different schemes for updating/feeding watchdogs.  If in this instance a periodic Clock function is used, then these servicing events will be comprehended by the reference power policy, and the device will be awoken for the servicing.  If this is not the case, can you can describe more about the usage/servicing of the watchdog?  There may be other ways to keep the watchdog happy while also doing power management...

    Regards,
    Scott