xTaskCreatePinnedToCore doesn't work for Core 1
Posted: Mon Sep 02, 2019 5:09 pm
Hi!
I'm currently debugging this piece of code for hours and can't see my fault - does anyone of you maybe have an idea?
So if I set to zero, it works flawlessly. If I set it to 1 - the device boots, "Task created..." is being printed but no life sign of the task can be seen on the serial port. I also tried to toggle a pin in the task - same picture (works with core=0, doesn't work core=1).
I'm using platformio with the platformio.ini
Is my brain faulty? My code or my esp32? Maybe someone can give me a pointer or try it out with his ESP-WROOM32.
Thanks!
Mark
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