Infinite loop When the scheduler active the lowest priority task

Hi, 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.
Can you explain me why?
Thank for any explication Creation of My Lowest Task : xTaskCreate( TaskLog,”TaskLog”, configMINIMALSTACKSIZE,NULL ,tskIDLE_PRIORITY + 2, NULL ); Definition of My Task: static void TaskLog (void * pvParameters) {
TickType_t          xLastWakeTime;
const TickType_t    xFrequency = 80;
FRESULT             rc;
xLastWakeTime = xTaskGetTickCount();

for(;;)
{

vTaskDelayUntil( &xLastWakeTime, xFrequency );

f_mount(0, &fatfsLOG);
rc = f_open(&filLOG, FileNameSdCard, FA_WRITE | FA_OPEN_ALWAYS);    
                         WriteSdCardFile(RTC_DateStructure,RTC_TimeStructure,sec_frac,GPSData_Wk,IMU1Data_Wk,IMU2Data_Wk);
DisableInterrupts();

f_close(&filLOG);
f_mount(0, NULL);
WriteBauderatefile();

DisableInterrupts();

}
}

Infinite loop When the scheduler active the lowest priority task

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 taskENTERCRITICAL() and taskEXITCRITICAL() instead. Regards.

Infinite loop When the scheduler active the lowest priority task

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. Thanks for explication.

Infinite loop When the scheduler active the lowest priority task

So TaskLog() never starts at all – is that right? 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. Regards.

Infinite loop When the scheduler active the lowest priority task

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. Is my Problem more clear? Thanks for explication ps: I use Eclipse and OpenOCD like debugger.

Infinite loop When the scheduler active the lowest priority task

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.
static void TaskLog (void * pvParameters) {
TickType_t          xLastWakeTime;
const TickType_t    xFrequency = 80;
FRESULT             rc;
xLastWakeTime = xTaskGetTickCount();

eTaskState EtatGPS, EtatCal, EtatLog;

for(;;)
{

vTaskDelayUntil( &xLastWakeTime, xFrequency );
WriteSdCardFile(RTC_DateStructure,RTC_TimeStructure,sec_frac,GPSData_Wk,IMU1Data_Wk,IMU2Data_Wk);

EtatGPS = eTaskGetState( TaskGps );
EtatCal = eTaskGetState( TaskCal );
EtatLog = eTaskGetState( TaskLog );

}
}

Infinite loop When the scheduler active the lowest priority task

I found the solution. The Stack size was to small. Now : configMINIMALSTACKSIZE * 15 Thanks for your time Have a Good Day

Infinite loop When the scheduler active the lowest priority task

Maybe a helpful link: http://www.freertos.org/FAQHelp.html It mentions how to monitor the stack and check for stack overflows. Regards.