collin80 / esp32_can

Arduino ESP32 library supporting the on-chip CAN module
MIT License
232 stars 84 forks source link

Any hints how to run on an ESP32-S3? (SOLVED with vTaskDelay(1); as found by lordryck) #54

Open MagnusThome opened 9 months ago

MagnusThome commented 9 months ago

I comment out everything regarding MCP2517FD and MCP2515 in both esp32_can.cpp and esp32_can.h (mainly so no to bother with the GPIOs and an open floating INT pin)

I change the GPIOs in esp32_can.cpp to 13 and 14 which is where the CAN transceiver is connected on my board. I also tried setting them with CAN0.setCANPins((gpio_num_t)13, (gpio_num_t)14);

But booting up stops and hangs on CAN0.begin(CAN_BPS_500K); and I never get any further?

MagnusThome commented 9 months ago

Ah, read through this thread https://github.com/collin80/esp32_can/issues/52 and added vTaskDelay(1); as described there and everything works!

collin80 commented 9 months ago

So, turns out I'm a moron and while I had this problem fixed ages ago, I never committed the changes and pushed them to github. I kept wondering why it worked fine for me and everyone else was having problems.

Sorry everyone... The recently pushed version should work better.

MagnusThome commented 9 months ago

@collin80

Thank you for your work!

And if you want a RejsaCAN board (https://github.com/MagnusThome/RejsaCAN-ESP32) from me just contact me at magnus@rejsa.nu

MagnusThome commented 9 months ago

Tested and works very well 👍