CAN-FD support for esp32s3

gautam-dev-maker
Posts: 3
Joined: Mon Jul 11, 2022 9:47 pm

CAN-FD support for esp32s3

Postby gautam-dev-maker » Tue Dec 27, 2022 12:30 pm

Hi,
I want to use CAN-FD with ESP32S3, since FD is faster than classical CAN. In ESP-IDF, TWAI is compatible with CAN, but not CAN-FD. The TWAI documentation features the following warning:
The TWAI controller is not compatible with ISO11898-1 FD Format frames, and will interpret such frames as errors.
I was wondering if there is any external component for making ESP32S3 compatible with CAN-FD.

Thank you.

DrMickeyLauer
Posts: 105
Joined: Sun May 22, 2022 2:42 pm

Re: CAN-FD support for esp32s3

Postby DrMickeyLauer » Fri May 12, 2023 4:20 pm

Unfortunately there is nothing ready made. Sadly, Espressif seems to ignore the fact that CAN-FD is spreading a lot. (Much like they ditched RMII, which I still can't understand).

What did you end up using? I have to do the same soon, trying to make a MCP251863 (MCP2518fd + transceiver) work with my ESP32C6.

samsonx
Posts: 3
Joined: Fri Jun 26, 2020 7:07 pm

Re: CAN-FD support for esp32s3

Postby samsonx » Mon May 15, 2023 5:58 am

DrMickeyLauer wrote:
Fri May 12, 2023 4:20 pm
Unfortunately there is nothing ready made. Sadly, Espressif seems to ignore the fact that CAN-FD is spreading a lot. (Much like they ditched RMII, which I still can't understand).

What did you end up using? I have to do the same soon, trying to make a MCP251863 (MCP2518fd + transceiver) work with my ESP32C6.
I'm going this same route! Currently have it working with hacked up canbed (separate 2518 and xcvr) am working on a board with the 251863

DrMickeyLauer
Posts: 105
Joined: Sun May 22, 2022 2:42 pm

Re: CAN-FD support for esp32s3

Postby DrMickeyLauer » Wed May 17, 2023 10:27 am

samsonx wrote:
Mon May 15, 2023 5:58 am
DrMickeyLauer wrote:
Fri May 12, 2023 4:20 pm
Unfortunately there is nothing ready made. Sadly, Espressif seems to ignore the fact that CAN-FD is spreading a lot. (Much like they ditched RMII, which I still can't understand).

What did you end up using? I have to do the same soon, trying to make a MCP251863 (MCP2518fd + transceiver) work with my ESP32C6.
I'm going this same route! Currently have it working with hacked up canbed (separate 2518 and xcvr) am working on a board with the 251863
Excellent. Would be cool to hear about your progress. By the way, as I'm working via ESP-IDF, not Arduino, I have yet to find a driver example for the MCP2518fd. I'm not yet working on it, but will be very soon. Perhaps we can share some code for that.

pirrup
Posts: 2
Joined: Thu Jun 08, 2023 10:03 am

Re: CAN-FD support for esp32s3

Postby pirrup » Thu Jun 08, 2023 12:32 pm

DrMickeyLauer wrote:
Wed May 17, 2023 10:27 am
samsonx wrote:
Mon May 15, 2023 5:58 am
DrMickeyLauer wrote:
Fri May 12, 2023 4:20 pm
Unfortunately there is nothing ready made. Sadly, Espressif seems to ignore the fact that CAN-FD is spreading a lot. (Much like they ditched RMII, which I still can't understand).

What did you end up using? I have to do the same soon, trying to make a MCP251863 (MCP2518fd + transceiver) work with my ESP32C6.
I'm going this same route! Currently have it working with hacked up canbed (separate 2518 and xcvr) am working on a board with the 251863
Excellent. Would be cool to hear about your progress. By the way, as I'm working via ESP-IDF, not Arduino, I have yet to find a driver example for the MCP2518fd. I'm not yet working on it, but will be very soon. Perhaps we can share some code for that.
Any progress on this ?

DrMickeyLauer
Posts: 105
Joined: Sun May 22, 2022 2:42 pm

Re: CAN-FD support for esp32s3

Postby DrMickeyLauer » Mon Nov 06, 2023 4:35 pm

Unfortunately no progress yet, but this will hopefully change in the next weeks. By now we have given up on using the internal CAN controller: We have produced a device w/ the builtin CAN controller, but could not achieve reliable timings (for details, see, e.g., https://github.com/espressif/esp-idf/issues/12316). I'm afraid this is a limitation of the Espressif Silicon.

Our new design uses the 2518fd and a matching transceiver. I have yet to write a driver, but I'll start checking out the options soon. There are a few existing drivers, like the generic MCP driver library (for this you will only have to provide the SPI glue logic, which is not much). There's also a pretty comprehensive ESP32/Arduino driver which would have to be rewritten for ESP-IDF, if we were to use it. And also two 3rdparty drivers, one from SeeedStudio and one from another guy. Last but not least, there is the Linux driver which also is pretty comprehensive and has great code quality.

To achieve our reliable timing constraints, we will probably have to utilize the timestamped transmit buffers in the MC2518fd. I did not check yet whether any of these existing libraries support that.

Did you get any further with your project? Since this is getting off-topic, we might want to communicate out of this board. Drop me a mail via mickey (at) vanille.de, if you're interested on collaborating. I'd be fine if this would be an open source driver, but it's not a necessity for us.

DrMickeyLauer
Posts: 105
Joined: Sun May 22, 2022 2:42 pm

Re: CAN-FD support for esp32s3

Postby DrMickeyLauer » Wed Dec 13, 2023 1:59 pm

Update: I have an alpha driver working, which is based on the very brillant https://github.com/Emandhal/MCP251XFD. The MCP2518fd is a great little chip ­– not without weaknesses, but I can't see anything better for CAN(-FD) at this point of time.

Who is online

Users browsing this forum: No registered users and 99 guests