hi guys
thank you
i started with smal steps with vTaskList /
otherwise with vTaskGetRunTimeStats
but get break:
Code: Select all
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h" // have included
#include "esp_system.h"
#include "nvs_flash.h"
extern void vTaskGetRunTimeStats( char *pcWriteBuffer );
void example_1_task(void *pvParameter) {
while (1) {
printf("hello from task 1\n");
vTaskDelay(873 / portTICK_PERIOD_MS);
}
}
void example_2_task(void *pvParameter) {
while (1) {
printf("hello from task 2\n");
vTaskDelay(1132 / portTICK_PERIOD_MS);
}
}
void example_3_task(void *pvParameter) {
while (1) {
printf("hello from task 3\n");
vTaskDelay(1823 / portTICK_PERIOD_MS);
}
}
void app_main(void) {
char pcWriteBuffer[1024] = "";
xTaskCreate(&example_3_task, "example_3_task", 2048, NULL, 5, NULL);
xTaskCreate(&example_1_task, "example_1_task", 2048, NULL, 5, NULL);
xTaskCreate(&example_2_task, "example_2_task", 2048, NULL, 5, NULL);
while(1) {
// vTaskList((char *) pcWriteBuffer);
vTaskGetRunTimeStats(( char *)pcWriteBuffer);
printf("Run Times:\n%s\n",pcWriteBuffer);
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
}
but i allways get this undefined for the task func
freertos/task.h is included in the code
where is my thinking mistake to this ?
must i have to change in component.mk that compiler find my archive in freertos ?
$ make all
CC hello_world_main.o
AR libmain.a
LD hello-world.elf
C:/eMbeddedHome2017/CLK_erzeuger/hello_world/build/main\libmain.a(hello_world_main.o):(.literal.app_main+0x1c): undefined reference to `vTaskGetRunTimeStats'
C:/eMbeddedHome2017/CLK_erzeuger/hello_world/build/main\libmain.a(hello_world_main.o): In function `app_main':
C:/eMbeddedHome2017/CLK_erzeuger/hello_world/main/hello_world_main.c:80: undefined reference to `vTaskGetRunTimeStats'
collect2.exe: error: ld returned 1 exit status
miss i other doing ?
in the build there is freertos created as folder
and there are tasks.o created..
best wishes
rudi
btw: if you test
you must change FreeRTOSconfig.h
to 1
https://github.com/espressif/esp-idf/bl ... fig.h#L191
to 1
https://github.com/espressif/esp-idf/bl ... fig.h#L192
edit:
@hans
read_task_info
edit:
added extern
and void *pvParameter