Description
Hardware:
Board: ESP32 Dev Module
Core Installation version: 1.01
IDE name: Arduino IDE?
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Windows 8
Description:
Hi! Im workin on a Can Bus Display right now, Im useing the on board Can Controler and external CAN transceiver.
TFT used: ili9341
Bluetooth running ANCS
For CAN Bus I Use this Library:
https://github.com/sandeepmistry/arduino-CAN
In Particular the Callback function : CAN.onReceive(onReceive);
I also send Frames in my loop() in 100ms Intervals to not block the Bus.
Everything works smooth but after a short while (sometimes 10sec /5sec) the Display shows pixel errors and the ESP restarts.
This is my investigation so far:
rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:10088
load:0x40080400,len:6380
entry 0x400806a4
**Guru Meditation Error: Core 1 panic'ed (Coprocessor exception)**
Core 1 register dump:
PC : 0x400d1adb PS : 0x00060031 A0 : 0x800d7bb8 A1 : 0x3ffbe9b0
A2 : 0x3ffc55b4 A3 : 0x00000001 A4 : 0x80093912 A5 : 0x00000000
A6 : 0x00000001 A7 : 0x3ffbaca0 A8 : 0x00000000 A9 : 0x000b4103
A10 : 0x000007e8 A11 : 0x000000fd A12 : 0x0ffdac00 A13 : 0x0000abab
A14 : 0x3ffb9a30 A15 : 0x00000000 SAR : 0x00000019 EXCCAUSE: 0x00000004
EXCVADDR: 0x00000000 LBEG : 0x400df614 LEND : 0x400df676 LCOUNT : 0x00000003
Core 1 was running in ISR context:
EPC1 : 0x400d1adb EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x40082941
Backtrace: 0x400d1adb:0x3ffbe9b0 0x400d7bb5:0x3ffbea90 0x400d7bc1:0x3ffbeab0 0x40081819:0x3ffbead0 0x4000bfed:0x00000000
Rebooting...
Exception Decoder spits this out:
Decoding stack results
0x400d406f: onReceive(int) at C:\Users\PETROS~1\AppData\Local\Temp\arduino_modified_sketch_534488/ESP32_BT_6.1_OBDTIME_1.6.1_ANCS_v1.7.2.ino line 2788
0x400d7e51: ESP32SJA1000Class::handleInterrupt() at C:\Users\Petros T\Documents\Arduino\libraries\CAN\src\ESP32SJA1000.cpp line 383
0x400d7e5d: ESP32SJA1000Class::onInterrupt(void*) at C:\Users\Petros T\Documents\Arduino\libraries\CAN\src\ESP32SJA1000.cpp line 410
Theese are the Lines inside the Lib:
void ESP32SJA1000Class::handleInterrupt()
{
uint8_t ir = readRegister(REG_IR);
if (ir & 0x01) {
// received packet, parse and call callback
parsePacket();
383 >>> _onReceive(available());
}
}
void ESP32SJA1000Class::onInterrupt(void* arg)
{
410 >>> ((ESP32SJA1000Class*)arg)->handleInterrupt();
}
This is what I tried so far:
-
Isolate the Can Recive task (without Callback) into separate RTOS Task, This works but slows the Whole Code down from 25FPS to 10FPS on ths display.
-> Not shure how to pass the callback function to a tasks, may this work? -
Tried to get other CAN Librarys to work -> also Too slow.
Hoping for help.