I have a problem with the scheduler and i am new with freeRTOS. It have a good fonctionnement with all other task but when it comes to active the lowest priority task, when the task is finish, it restarts at the beginning of this task infinitly. It loop.
I’m not sure I follow the description of the problem. Your task is implemented as an infinite loop - as would be normal. When it gets to the bottom of the for(; loop I would expect it to go back to the top of the for(; loop - are you saying instead of doing that it is going right back to the top of the function - so executing the call to xTaskGetTickCount() again?
By the way - you should not disable and enable interrupts directly, but use taskENTER_CRITICAL() and taskEXIT_CRITICAL() instead.
No, sorry i think my explication was not very complete. I have 6 task. and when the scheduler run, it active task 1 ( the highest priority task ) , after task 2, task 3 ,… and when it active the last and lowest priority task ( My TaskLog joined before ), the scheduler don’t active the task 1 when this task is finish. It just active always the last task.
If so, what happens? Does the system crash, or does the higher priority
task just continue running?
If the higher priority task continues running, does it ever enter the
Blocked state? If it does not enter the Blocked state then it will
starve the lower priority tasks of processing time.
No, TaskLog is the lowest priority task, and when the scheduler reach it (it is the last task call in my program ), TaskLog repeat itself infinity. The scheduler never pause this task for reaching the highest or an other task.
When i done a eTaskGetState() for all task; All task are ready to execute.
i have 4 task with priority of 3 , 1 task with priority of 2 and TaskLog priority of 2.
I just want that the scheduler authorize the highest task just after the lowest task is finish.
I found that, the task loops infinitly just when i put the f_open function in. Now when i erase f_open, the task finish but the scheduler do nothing and the program look like it don't crash, but probably scheduler crash and no others task is reach.