SimpleFOC CAN communication efforts

Hi everyone!

I’m actually surprised how much work has been done in the community on different aspects of the CAN communication. Even across different platforms.

Here are a couple of libraries that I was able to find (I’m sure that there are more that I didn’t see yet :slight_smile: ):

Many of them! And much more advanced than I thought! Here is a quick breakdown of how I see their main characteristics:

Library MCU architectures CAN potocol SimpleFOC integration
SimpleCanLib ESP32, ESP32-S3, STM32G431B CAN No
SimpleCAN ESP32, STM32G0, STM32G4, STM32L4, STM32H7, Portenta CAN and CAN FD No
Simple-FOC-CAN ESP32 CAN Yes (CANCommander)
SimpleFOC_CAN_STM32 ESP32 and STM32F405 CAN Yes (CANCommander)
CanFD branch of stm32-bldc-foc STM32G431C CAN FD Yes? (CANCommander)

It’s a pity that we did not go through with this before and standardised it within one single “official” library. I’m going to try to compile the effort of the community, if someone is interested in collaborating let me know. I’d like to extend the work on the CANCommander and try to integrate all the cross-platform codes into one library.

From what I’ve seen Owen’s SimpleCAN library is written in the most cross-platform way, supporting the most of architectures and both CAN FD and classic CAN. I’m thinking of implementing the @Matt303 's and @Jason_Kirsons’s CANCommander in this library. To be fair most of the libraries work with esp32 and stm32 so any library could be the starting point for the unification effort.

Let me know what you think

It is great to have such a summary! To be fair, I must say that my SimpleCanLib is based on Owen’s work. The main difference between my lib and others is the encapsulation of all interrupt stuff into the library, so that all calls to the lib are less time criticall and can use serial etc. without crashing. Alao, I tried to have two clearly distinct layers, one for the low level CAN and one for a higher level protocol (which could for example be CANCommander compatible). Needless to say, all calls are non-blocking. Adding support for CAN FD on the G431 would be easy, but requires a proper setup with testing. In any case, I believe it would be great to suppoirt CAN a bit more since it is working really well in practice and is very convenient for many applications with multiple (more than two) connected MCUs.