<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi everyone,<br>
<br>
Wolfgang (Zoe) and I just stumbled upon an ancient bug in the CAN TX
buffer handling of the OBD2 polling framework.<br>
<br>
After checking other modules, I found the same code quite often, so
vehicles not using the poller might be affected as well.<br>
<br>
Waiting for some TX to get finished is almost everywhere done with
this snippet:<br>
<br>
<font size="+1"><tt> while (TXB0CONbits.TXREQ) {} // Loop until TX
is done</tt><br>
</font><br>
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.<br>
<br>
Solution:<br>
<br>
<font size="+1"><tt> while ((TXB0CON & 0b00111000) ==
0b00001000) {} // wait for TX done / error</tt></font><br>
<br>
This loop ends on both TX error conditions and after successful
transmits.<br>
<br>
The fix for vehicle.c is here:<br>
<a class="moz-txt-link-freetext" href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System/commit/13c68e95d8daec46f3aea36e4ca67f63af5bf44b">https://github.com/openvehicles/Open-Vehicle-Monitoring-System/commit/13c68e95d8daec46f3aea36e4ca67f63af5bf44b</a><br>
<br>
Regards,<br>
Michael<br>
<br>
<pre class="moz-signature" cols="72">--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
</body>
</html>