A little help would go a long way!
I am trying to use FreeRTOS with PlatformIO on my M5Stack Core 2
I can get it to work on cpu core 1 but not on cpu core 0. Any suggestions?
I am suspicious that it has to do with SPI communication with the LCD screen. I am hoping I am doing something wrong. It is easier to fix my faults than those of TFT_eSPI or M5Display.
Thanks in advance!
Code snippet
xTaskCreatePinnedToCore(loop,"task1",8192,NULL,1,taskHandle,1); //Works
xTaskCreatePinnedToCore(loop,"task2",8192,NULL,1,taskHandle,0); // Sets CPU in panic and reboots
void loop(void *parameters) {
while(1) {
M5.Lcd.println("Somthing to think about!");
Serial.println("Something to ponder?");
delay(1000);
}
Stacktrace
Backtrace: 0x4008a380:0x3ffbe4f0 0x4008a5f9:0x3ffbe510 0x400e73e7:0x3ffbe530 0x40086195:0x3ffbe550 0x400d29a9:0x3ffb5ce0 0x400d3941:0x3ffb5d00 0x400d3e15:0x3ffb5d80 0x400d33a9:0x3ffb5df0 0x400fba1b:0x3ffb5e20 0x400d6232:0x3ffb5e40 0x400d6311:0x3ffb5e60 0x400d5f4e:0x3ffb5e80 0x400d5e74:0x3ffb5fd0 0x4008b5fe:0x3ffb5ff0
#0 0x4008a380:0x3ffbe4f0 in invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715
#1 0x4008a5f9:0x3ffbe510 in abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:715
#2 0x400e73e7:0x3ffbe530 in task_wdt_isr at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/task_wdt.c:252
#3 0x40086195:0x3ffbe550 in _xt_lowint1 at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/xtensa_vectors.S:1154
#4 0x400d29a9:0x3ffb5ce0 in TFT_eSPI::setWindow(int, int, int, int) at .pio/libdeps/m5stack-core2/M5Core2/src/utility/In_eSPI.cpp:6120
#5 0x400d3941:0x3ffb5d00 in TFT_eSPI::drawChar(int, int, unsigned short, unsigned int, unsigned int, unsigned char) at .pio/libdeps/m5stack-core2/M5Core2/src/utility/In_eSPI.cpp:6120
#6 0x400d3e15:0x3ffb5d80 in TFT_eSPI::drawChar(unsigned short, int, int, unsigned char) at .pio/libdeps/m5stack-core2/M5Core2/src/utility/In_eSPI.cpp:6120
#7 0x400d33a9:0x3ffb5df0 in TFT_eSPI::write(unsigned char) at .pio/libdeps/m5stack-core2/M5Core2/src/utility/In_eSPI.cpp:6120
#8 0x400fba1b:0x3ffb5e20 in Print::write(unsigned char const*, unsigned int) at /Users/noname/.platformio/packages/framework-arduinoespressif32/cores/esp32/Print.cpp:42
#9 0x400d6232:0x3ffb5e40 in Print::write(char const*) at /Users/noname/.platformio/packages/framework-arduinoespressif32/cores/esp32/Print.cpp:261
#10 0x400d6311:0x3ffb5e60 in Print::print(char const*) at /Users/noname/.platformio/packages/framework-arduinoespressif32/cores/esp32/Print.cpp:261
(inlined by) Print::println(char const*) at /Users/noname/.platformio/packages/framework-arduinoespressif32/cores/esp32/Print.cpp:195
#11 0x400d5f4e:0x3ffb5e80 in M5OS::ScreenClass::println(char const*, ...) at lib/M5OS/src/Screen.cpp:31
#12 0x400d5e74:0x3ffb5fd0 in loop(void*) at main.cpp:10 (discriminator 1)
#13 0x4008b5fe:0x3ffb5ff0 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)