collin80 / esp32_can

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

CAN Reliable timings possible? #55

Closed mickeyl closed 1 year ago

mickeyl commented 1 year ago

My team and I are working on a commercial CAN-adapter using the ESP32S3. Since some of our customers are using this adapter to reflash ECUs, we sometimes have strong timing requirements, e.g. 350µs between every consecutive CAN frame.

I tried to hack this into the default ESP IDF TWAI driver, but didn't succeed. Even without my changes though, the default driver has very unstable timing.

Now I wonder whether I could do that based on your driver. Did you do some measurements to check the timing stability? Do you think there would be a (straightforward) way to add such timing constraints on the driver level (I think this is the best place, I don't think application level is the right way)?

mickeyl commented 1 year ago

Ok, upon giving a closer look, it looks like you're abstracting the standard driver, not replacing it, so there is no change in timing likely.