Hi everyone, Wolfgang (Zoe) and I just stumbled upon an ancient bug in the CAN TX buffer handling of the OBD2 polling framework. After checking other modules, I found the same code quite often, so vehicles not using the poller might be affected as well. Waiting for some TX to get finished is almost everywhere done with this snippet: while (TXB0CONbits.TXREQ) {} // Loop until TX is done Problem: this loop does not end if the PIC runs into a TX error, because TXREQ won't get cleared then. So a TX problem with the CAN bus triggers the watchdog reset. Solution: while ((TXB0CON & 0b00111000) == 0b00001000) {} // wait for TX done / error This loop ends on both TX error conditions and after successful transmits. The fix for vehicle.c is here: https://github.com/openvehicles/Open-Vehicle-Monitoring-System/commit/13c68e... Regards, Michael -- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
participants (1)
-
Michael Balzer