Hi all,
I have working with i.MX27 multimedia application processor.I am using FreeRTOS v4.7.1 and IAR embedded workbench v5.11 for my project.I am newbie to the FreeRTOS.I have created simply 3 tasks and assign the priorities.there is no problem when tasks have different priotities.
But if i assign the same priority for 2 or 3 tasks,it will point out last priority task only.if task 1 and 2 have same priority,it points 2nd task only or tasks 1&3 or 2&3 have same priority,it points 3rd task only.
I dont know what will happened on 2 or more tasks have the same priority.so anyone suggest idea for my problem.
Do you have configUSE_PREEMPTION set to 1 in FreeRTOSConfig.h?
If so, can you create three very simple tasks (may that do nothing but flash an LED each, then sleep) that have a similar structure to your real tasks to see if these run as expected - and if not post the code for these simple tasks here.
Hi richardbarry,
Thanks for your quick reply.Now i am currently working in IAR Embedded Workbench v5.11 simulator.I have no any hardware device.so i cant able to check in hardware device.I have write my piece of code here.
Yes,i have configUSE_PREEMPTION set to 1 in FreeRTOSConfig.h.If i have assign the same priorities for tasks 2&3 or 1&3,scheduler points k++(task3)only.it will go to j++(task2) or i++(task1)respectively, when i suspend the 3rd task only.what will happened if a one of the task has same priority.
maybe it is just a typing mistake but your for() loop is missing ; - it should be for(;;){}. And also you should have a wait condition of somekind - maybe just a vTaskDelay(some_ticks); . Otherwise your highest task will not do a context switch to a task of lower priority.
The IAR simulator is a core only simulator. This means it does not simulate the timer and therefore the tick interrupt will not be executing. Without the tick interrupt you will never switch tasks unless you use a taskYIELD() statement - I’m not sure if the yielding works in the simulator but I would guess that it did.