pierremolinaro / acan-t4

CAN / CANFD Arduino Library for Teensy 4.0
MIT License
17 stars 4 forks source link

ACAN_T4::can3.transmitErrorCounter() in CANFD? #9

Closed syrinxtech closed 5 months ago

syrinxtech commented 5 months ago

Pierre,

I've been using the library for a while now and had been using ACAN_T4::can3.transmitErrorCounter() in my code. Since I upgraded to the current version, I'm getting a lot of Transmit EC: 97 in my logs. This log entry represents the error code from the previously mentioned function call immediately after a ACAN_T4::can3.tryToSendReturnStatusFD() call. I wasn't getting any error codes from the previous version of the library. I looked in the manual and didn't see a reference to this function call in the CANFD section, only the CAN 2.0B section. Is this call valid in CANFD?

One more thing, any idea what the number represents? It's not the same all the time. It seems to start at some number, count down for a number of packets, then disappear, only to reappear later with a different starting number.

Thanks, Bryan

pierremolinaro commented 5 months ago

Hello Bryan,

I have forgotten this function in the documentation, it is available for CANFD.

Do you use CAN FD frame with bit rate switch ? If not, the timing constraints are the same as CAN 2.0B, even if you use CAN FD frame without bit rate switch. So the Transmit EC should have the same behaviour as in CAN 2.0B.

If yes :

Best Regards,

Pierre

Le 6 avr. 2024 à 17:36, Bryan Miller @.***> a écrit :

Pierre,

I've been using the library for a while now and had been using ACAN_T4::can3.transmitErrorCounter() in my code. Since I upgraded to the current version, I'm getting a lot of Transmit EC: 97 in my logs. This log entry represents the error code from the previously mentioned function call immediately after a ACAN_T4::can3.tryToSendReturnStatusFD() call. I wasn't getting any error codes from the previous version of the library. I looked in the manual and didn't see a reference to this function call in the CANFD section, only the CAN 2.0B section. Is this call valid in CANFD?

Thanks, Bryan

— Reply to this email directly, view it on GitHub https://github.com/pierremolinaro/acan-t4/issues/9, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVCCIU4Z6NN67B67TQLY4AI6ZAVCNFSM6AAAAABF2Q4QFWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZDSMRZHA4DQMI. You are receiving this because you are subscribed to this thread.

syrinxtech commented 5 months ago

Pierrre,

Yes, I do use bit rate switch (1Mbps/5Mbps). I'm using two Teensy 4.0's and one Teensy 4.1, all with the Adafruit NXP TJA1051T/3 CANBus transceiver. All 3 Teensy's are configured identically. I think I may have had something weird in my code, because I recompiled and those weird error count messages disappeared. False alarm I guess.

Thanks for the quick response.