I'm currently debugging this piece of code for hours and can't see my fault - does anyone of you maybe have an idea?
Code: Select all
static int taskCore = 1;
void coreTask(void *pvParameters) {
String taskMessage = "Task running on core " + xPortGetCoreID();
while (true) {
Serial.println(taskMessage);
delay(1000);
}
}
void setup() {
Serial.begin(115200);
int temp = xTaskCreatePinnedToCore(
coreTask, /* Function to implement the task */
"coreTask", /* Name of the task */
1000, /* Stack size in words */
NULL, /* Task input parameter */
0, /* Priority of the task */
NULL, /* Task handle. */
taskCore); /* Core where the task should run */
if(temp) {
Serial.println("Task created...");
} else {
Serial.printf("Couldn't create task %i", temp);
}
}
void loop() {}
Code: Select all
taskCore
I'm using platformio with the platformio.ini
Code: Select all
[env:esp32dev]
platform = espressif32
board = esp-wrover-kit
framework = arduino
monitor_speed = 115200
build_flags = -DCORE_DEBUG_LEVEL=5
Thanks!
Mark