KevinOConnor / can2040

Software CAN bus implementation for rp2040 micro-controllers
GNU General Public License v3.0
636 stars 63 forks source link

CAN2040_NOTIFY_TX received when bus disconnected #51

Closed obdevel closed 2 months ago

obdevel commented 4 months ago

During some experimentation, I discovered that the callback function may trigger with CAN2040_NOTIFY_TX even when the bus is physically disconnected. I had previously sent some frames and expected they'd be stuck in the output buffer. The spurious notification seems to happen unpredictably some time later, or not.

Is this due to floating inputs on the transceiver appearing to be an ack from another (non-existent) node and confusing the state machine ?

This is not a problem for me; merely a curious observation. Although the output buffer being full for some seconds could be a useful indicator of disconnection from the bus or wiring problems, by implication.

KevinOConnor commented 4 months ago

A transmit message notification should only occur after the message contents have been fully confirmed on the CANRX line (including header, body, crc, ack, and eof bits). So, hard to see how line noise could cause that.

I'd guess a trace of the CANRX/CANTX lines and a log of the can2040 function calls would be needed to figure out what happened.

Cheers, -Kevin

github-actions[bot] commented 2 months ago

Hello,

It looks like there hasn't been any recent updates on this github ticket. We prefer to only list tickets as "open" if they are actively being worked on. Feel free to provide an update on this ticket. Otherwise the ticket will be automatically closed in a few days.

Best regards,

~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.