Teensyduino compatible CAN library

Status
Not open for further replies.

digysol

Member
I am working with a Teensy 3.5 and a Teensy 3.6. Any CAN library available that is compatible with Teensyduino and works with these Teensy boards ?
 
The pawelsky version is pretty much drop-in compatible with the FlexCAN library that comes with the TeensyDuino installation (as far as I know the one that comes with the installation is the teachop version). The teachop version does not support the second can bus on the Teensy 3.6.

There are actually three versions of the same library. In ascending order of forking we have:

https://github.com/teachop/FlexCAN_Library (Teensy 3.1)
https://github.com/pawelsky/FlexCAN_Library (Teensy 3.1 - 3.6)
https://github.com/collin80/FlexCAN_Library (Teensy 3.1 - 3.6)

Yep, that last one is me. It's a fork of the pawelsky version and basically adds interrupt driven Rx/Tx and callbacks. But, the library API has been changed so it isn't drop-in compatible with the first two - not everything changed though, mostly just initialization.
 
Hi Paul. I have been looking at UAVaersospace and UAVcan for a little bit now - since tonton81 put together his new CAN library.

If you look at the reference the driver is there for the Teensy and uses Flexcan library but haven't seen any projects out there. In my research also came across what may be simpler to start with called Libcanard:
Libcanard
Libcanard is a minimal implementation of UAVCAN in C, suitable for deeply embedded systems and resource constrained applications. It is primarily targeted for low-end microcontrollers, starting from 8 KB ROM and 6 KB RAM.
The GitHub page is: https://github.com/UAVCAN/libcanard. I did see some people on the one of the forums say they got the example working on two arduinos? I figure if it can be done the Arduino it can be done on a Teensy :)

Anyway going to look at it further and see if I can get at least libcanard working and then maybe the other implementation. Will take a while since I don't have any clue about UAVcan. So will have a learning curve.

Mike
 
@PeterPetersen. Yep. Just as a FYI I'm the one that opened the issue. As a status I actually am in the process of porting it into the IDE format. Right now I got it to the point where it sees all routines, but getting numerous undefined references, for instance:
Code:
C:\Users\CYBERP~1\AppData\Local\Temp\arduino_build_880129\sketch\uavcan_node_airspeed.ino.cpp.o: In function `uavcan::GlobalDataTypeRegistry::RegistrationResult uavcan::GlobalDataTypeRegistry::registerDataType<uavcan::protocol::NodeStatus_<0> >(uavcan::DataTypeID)':
c:\users\cyberp~1\appdata\local\temp\arduino_build_880129\sketch\uavcan\node/global_data_type_registry.hpp:218: undefined reference to `uavcan::GlobalDataTypeRegistry::remove(uavcan::GlobalDataTypeRegistry::Entry*)'
c:\users\cyberp~1\appdata\local\temp\arduino_build_880129\sketch\uavcan\node/global_data_type_registry.hpp:230: undefined reference to `uavcan::GlobalDataTypeRegistry::remove(uavcan::GlobalDataTypeRegistry::Entry*)'
c:\users\cyberp~1\appdata\local\temp\arduino_build_880129\sketch\uavcan\node/global_data_type_registry.hpp:236: undefined reference to `uavcan::GlobalDataTypeRegistry::registImpl(uavcan::GlobalDataTypeRegistry::Entry*)'
 
Hi, I am new to Teensy and have some questions regarding CANBUS on Teensy 3.5 and 3.6.
As I understand it there are at least these 3 libraries:

https://github.com/teachop/FlexCAN_Library (Teensy 3.1) NOT 3.6.
https://github.com/pawelsky/FlexCAN_Library (Teensy 3.1 - 3.6)
https://github.com/collin80/FlexCAN_Library (Teensy 3.1 - 3.6)

1. Which one is included in the latest (december 2019 download) TeensyDuino installation ?
2. Are there now also any other library to consider, and what are the benefits ?

I have also some Teensy 4 controllers and for the future it would be nice to have one library .

(I have CAN running on Arduino UNO, Adafruit Feather M0 and M4, ESP32...)

/Christer
 
Status
Not open for further replies.
Back
Top