Hello,
I’m running FreeRTOS on FRDM-K22F and it’s not behaving as expected.Putting some code to explain what’s going on:
~~~
static const char text1[] = “Periodic taskrn”;
static const char text2[] = “Continous Taskrn”;
static const char text3[] = “Continous Task 2rn”;
void periodicTask(void
pvParameter)
{
TickType_t prevCount;
char *printText = (char)pvParameter;
prevCount= xTaskGetTickCount();
for(;;)
{
printf(printText);
vTaskDelayUntil(&prevCount,pdMS_TO_TICKS(5));
}
}
void continousTask(void
pvParameter)
{
char *printText = (char)pvParameter;
for(;;)
{
printf(printText);
}
}
int main(void)
{
xTaskCreate(periodicTask,"periodic task",200,(void*)text1,3,NULL);
xTaskCreate(continousTask,"continous task",200,(void*)text2,0,NULL);
//xTaskCreate(continousTask,"continous task 2",200,(void*)text3,0,NULL);
vTaskStartScheduler();
while(1)
{
}
return 0 ;
}
~~~
So if i create periodic and continous task, basicaly only continous runs all the time, sometimes periodic fires but no at desired rate(every 3ms) that shouldn’t happend because periodic got higher priority.
Now lets go to time slicing, if i create 2 continous tasks with same priority only one runs even if i got defined configUSE
TIMESLICING as 1. Shouldn’t they get same amount of time?
I’m pretty new in FreeRTOS but i’m pretty sure something is not correct