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/CC2640: Issue with assiging task with priority 0

Part Number: CC2640

Tool/software: TI-RTOS

Hi,

I was trying to blink a led in my CC2640 R2F board using task. While creating task if give the priority as 0 to my custom task, my program is not working. If i give the priority other than 0 then its seems to be work fine. can any one tell me why this is happening? I studied like 0 priority is ideal task. if so we cant assign same priority for 2 task?? if i assign priority 1 for 2 task its working fine. why issue is only with priority 0 can any one help me ?

Thanks, 

Stebin J Tharakan

  • Hi Stebin,

    The problem here is that you are trying to run another task alongside the idle task. When the idle task is running it will call the Power_standbyPolicy that tries to put the device into the lowest power mode available. Following this, it will go into an "Wait for interrupt"-state which means it will block the other task until an event to bring it out of this occur.

    In short, don't count on the other task getting much time (or any at all) as the idle task typically don't yield itself (sleeps or pends on semaphores). You should consider priority 1 as the lowest priority for your application tasks and reserve priority 0 for the idle task if this is present in the system.

    You could also disable the idle-task to "free up" priority 0 but this is not recommended as you will have to do do the transition into low-power modes yourself by calling Power_standbyPolicy where appropriate.
  • Hi MW,

    Thanks for your reply. My doubt is cleard