More than one task cannot be created in arduino micro. #14
Replies: 4 comments
-
You are not setting the Task Stack large enough. There is a configuration define for Also, just for reference. The Idle Task is automatically defined by FreeRTOS, and in this library anything you put into the |
Beta Was this translation helpful? Give feedback.
-
what is your configTOTAL_HEAP_SIZE ? it is not mentioned in the configuration document. I have commented Idle task, its not been used i. |
Beta Was this translation helpful? Give feedback.
-
As noted in the README, the heap allocation is based on Also, please note that there no need to add |
Beta Was this translation helpful? Give feedback.
-
I was using freeRtos v8.3 so it was not working. i replaced it by version 9, now it is working. thanks for your help. Spoorthy |
Beta Was this translation helpful? Give feedback.
-
hi,
I am not able to create more than one task in arduino micro. i have used FreeRTOS example programs to start with the RTOS programming.
#include <Arduino_FreeRTOS.h>
//
void setup()
{
Serial.begin(9600);
Serial.println(F("In Setup function"));
/* Create two tasks with priorities 1 and 2. An idle task is also created,
which will be run when there are no tasks in RUN state */
xTaskCreate(MyTask2, "Task2", 64, NULL, 1, NULL);
xTaskCreate(MyTask1, "Task1", 64, NULL, 1, NULL);
//xTaskCreate(MyIdleTask, "IdleTask", 100, NULL, 0, NULL);
vTaskStartScheduler();
}
void loop()
{
// DO nothing
}
/* Task1 with priority 1 /
static void MyTask1(void pvParameters)
{
while(1)
{
Serial.println(F("Task1"));
//vTaskDelay(100/portTICK_PERIOD_MS);
delay(200);
}
}
/* Task2 with priority 2 /
static void MyTask2(void pvParameters)
{
while(1)
{
Serial.println(F("Task2"));
//vTaskDelay(150/portTICK_PERIOD_MS);
delay(100);
}
}
/* Idle Task with priority Zero /
static void MyIdleTask(void pvParameters)
{
while(1)
{
Serial.println(F("Idle state"));
delay(50);
}
above was the program i had used.
Beta Was this translation helpful? Give feedback.
All reactions