esp32_can icon indicating copy to clipboard operation
esp32_can copied to clipboard

Using this library with Arduino Due

Open AlexandreBras opened this issue 6 years ago • 1 comments

Hello.

I am having troubles trying to modify and run this library with Arduino Due.

I want to use it because I already use due_can.h for built in CAN bus of Arduino Due and that works just fine. I really like this library.

My pcb has the built in CAN (named CAN0 and CAN1) and external CAN (named CAN2) with MCP2517FD through SPI. So it has 2 normal CAN and 1 CAN FD channel.

I would like to know what are the modifications that are necessary or where can I start, since I only need CAN FD from esp32_can.

AlexandreBras avatar Nov 15 '19 15:11 AlexandreBras

Hmmm, yes I could see how that could be useful. I never did port over the CAN FD stuff. It should be possible as the underlying base is pretty similar but I did edit the can_common code to add support for 64 byte long packets like you can have on FD networks. I'm not really sure exactly what it would entail to move the code over to work with the Due. I've just been too busy to attempt to do it myself.

But, one thing you'd have to do is use the can_common stuff from the ESP32 library here then grab the mcp2517fd files. But, unfortunately the whole library uses ESP32 threads all over the place. There are threading libraries for the Due. Barring that you'd have to edit everything to be polled instead of everything being a separate thread.

It's probably obvious having seen the code that I never really had any intention to support the Due. Sorry I don't have better news there. It's possible to convert the code over but it'll take some effort to do it.

collin80 avatar Nov 21 '19 01:11 collin80