Please Help me,
I try use the freeRTOs command is not working?
The compilation error:
I would like to know where I am going wrong?
What should I do ?
My code:
extern "C"{
#include "freertos/FreeRTOS.h"
#include <freertos/task.h>
#include "freertos/timers.h"
#include "freertos/queue.h"
}
....
xTaskCreatePinnedToCore(v_PrintTask, "v_PrintTask", 4096, NULL, tskIDLE_PRIORITY, &Handle_PrintTask, tskNO_AFFINITY);
void v_PrintTask(void *parameters) {
while(1) {
UBaseType_t numTasks;
TaskStatus_t *taskStatusArray;
numTasks = uxTaskGetNumberOfTasks();
taskStatusArray = (TaskStatus_t *)pvPortMalloc(numTasks * sizeof(TaskStatus_t));
if (taskStatusArray != NULL) {
numTasks = uxTaskGetSystemState(taskStatusArray, numTasks, NULL);
for (int i = 0; i < numTasks; i++) {
Serial.printf("Task Name: %s, Status: %s, Priority: %u, Stack High Water Mark: %u\n",
taskStatusArray[i].pcTaskName,
(taskStatusArray[i].eCurrentState == eRunning ? "Running" : "Blocked"),
taskStatusArray[i].uxCurrentPriority,
taskStatusArray[i].usStackHighWaterMark);
}
vPortFree(taskStatusArray);
}
vTaskDelay(1500 / portTICK_PERIOD_MS);
}
}
The compilation error:
/home/allacmc/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /tmp/arduino/sketches/758AE0273AE4F87A05FA14066003C8E7/sketch/objs.a(MapaTemperatura_LVGL_v4.ino.cpp.o):(.literal._Z11v_PrintTaskPv+0xc): undefined reference to `uxTaskGetSystemState'
/home/allacmc/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /tmp/arduino/sketches/758AE0273AE4F87A05FA14066003C8E7/sketch/objs.a(MapaTemperatura_LVGL_v4.ino.cpp.o): in function `v_PrintTask(void*)':
/home/allacmc/Arduino/MapaTemperatura_LVGL_v4/MapaTemperatura_LVGL_v4.ino:321: undefined reference to `uxTaskGetSystemState'
collect2: error: ld returned 1 exit status
Multiple libraries were found for "SD.h"
Used: /home/allacmc/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/SD
Not used: /home/allacmc/.arduino15/libraries/SD
exit status 1
Compilation error: exit status 1