I am trying to run two tasks using FreeRTOS APIs. I followed the Handson Tutorial pdf of FreeRTOS, but my task runs just once and stops.I am using the FreeRTOS kernel on x86 Intel. I am able to compie and run the code.
My OS is Ubuntu, I am using Eclipse Toolchain with GCC. If anyone has experience with this, they could give me some pointers as to how to do it right.
Here is my code:
static unsigned long uxQueueSendPassedCount = 0;
void vTask1(void *pvParameters)
{
const char *str_to_display="This is task1\n\r";
while(1)
{
printf("%s",str_to_display);
vTaskDelay(1000);
}
}
void vTask2(void *pvParameters)
{
const char *str_to_display="This is task2\n\r";
while(1)
{
printf("%s",str_to_display);
vTaskDelay(1000);
}
}
int main()
{
xTaskCreate(vTask1, (signed char *)"Task1",1000,NULL,3,NULL);
xTaskCreate(vTask2,(signed char *)"Task2",100,NULL,1,NULL);
vTaskStartScheduler();
while(1)
{
}
return 0;
}
Update: Other things i tried :
Created just one task, with infinite loop and it runs as expected,
Created just one task, added
vTaskDelay
, and i get an error "Segmentation fault (core dumped)"
(void)pvParameters;
– user3629249