-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Can Bus - ISR makes Guru Meditation Error: Core 1 panic'ed (Coprocessor exception) #3661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I found the issue, It its not allowed to have a Float variable inside the Callback function. After replacing this with a Double variable everything works!
|
@Petros144 any reason not to use the built-in CAN framework? |
@atanisoft I need the speed provided via Interrrupt routine. now it works :)! |
Thank you so much! I've got demo in 5 hours and had the exact same error with my code:
I pulled the += statments out of the ISR and it worked perfectly! |
I got the same issue in the interrupt handler procedure. Replacing float variable with double one solved the issue. I think it can be marked as a bug in working with float in ISR. |
Hello @Petros144 , I am also using saem code , similar CANbus tests |
Just for convenience, the forum post in question is: https://esp32.com/viewtopic.php?t=1292 |
Does the TWAI driver (the built-in CAN framework) support callback function so that every time a package is received, a function is executed? |
It only supports polled |
That means some packages will be lost if our receive function is executed at the end of the void loop, right? |
You can control how many frames will be buffered for reading when you configure the TWAI driver. You can also do as the examples do and run a higher priority task (not in |
Do you mean this example? https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/TWAI/TWAIreceive/TWAIreceive.ino And one final question, are you aware if it's actually possible to read a single-wire CAN? (33.3kbps GMLAN). |
That doesn't use a dedicated task, it uses polled. https://github.com/espressif/esp-idf/blob/release/v4.4/examples/peripherals/twai/twai_network/twai_network_slave/main/twai_network_example_slave_main.c shows using multiple tasks, you should focus primarily on calls involving |
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:
Exception Decoder spits this out:
Theese are the Lines inside the Lib:
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.
The text was updated successfully, but these errors were encountered: