FlexCAN library used on Teensy

Status
Not open for further replies.
I have been developing NMEA 2000 library and would like to add support for latest FlexCAN library. Which fork is used by Teensy project?
 
The latest FlexCAN library coming with Teensy has some bugs, which I would like to fix. Some fixes are critical for using FlexCAN on NMEA2000 bus. I also made developed version of collin80 fork, which should still be compatible with current Teensy version.

So how Teensy FlexCAN could be updated?
 
So it has not been updated for a while and either collin80 has not merged or commented my pull request with improvements. Specially I wonder that newer version of FlexCAN uses interrupt handling for receiving as transmitting messages, but there is no locking mechanism for reading and writing buffers buffers outside of interrupt.

So the question is still open - how FlexCAN could be updated for Teensy project?
 
Specially I wonder that newer version of FlexCAN uses interrupt handling for receiving as transmitting messages, but there is no locking mechanism for reading and writing buffers buffers outside of interrupt.
I wondered about this, too, when doing my last CAN experiments with my small test setup. But it worked without errors for simple communication between two microcontrollers.

Perhaps your request is better seen, if you post in in the Teensyduino Beta thread on top of the forum. Or post below under "Suggestions & Bug Reports".

And Paul may not have recognized you as the man from this super long thread in the Arduino forum ... :)
 
After I got new version working by fixing other issues (e.g. uninitialized variable before use) it also worked, but I had some message lost. After locking fix I have had 0 loss. Also current write may mix the order of send messages and right order is important specially with NMEA 2000 protocol fastpackets.
 
After locking fix I have had 0 loss. Also current write may mix the order of send messages and right order is important specially with NMEA 2000 protocol fastpackets.
Ok, that's good to know. I've planned to move my ISO-TP work from mbed to Teensy.

Are you going to make a second post or should I try it ?
 
By the way I had to add ISO-TP reception handling to NMEA 2000 library, since that was mandatory feature. It currently does not have ISO-TP sending.
 
By the way I had to add ISO-TP reception handling to NMEA 2000 library, since that was mandatory feature. It currently does not have ISO-TP sending.
Ok, if I'll find some time I will look after this. The mbed version is currently based on mbed multithreading, so the first step is to decide about a redesign.
 
So is still there a way to have ISO-TP support based on the FlexCAN lib for receiving e.g. a VIN via OBD request in Mode 0x09 to PID 0x02 ?
 
Well, I think simply receiving ISO-TP is a use case for FlexCAN's attachObj feature. A class acting as a state machine seems to be a good solution for this.

Sending is much more complicated. It must follow the timing and wait requests coming from the receiving side. Using Arduino delay is not a good idea here, so threading or a timer lib is required.
 
My original question is still open. Could FlexCan library provided with Teensyduino be my developed version. Now when people installs Teensyduino, it installs as default the version, which does not work right with NMEA2000. So to get things working, they have to manually remove FlexCan under "C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FlexCAN"
 
Status
Not open for further replies.
Back
Top