[Ovmsdev] debugging CAN bus error flags

Michael Balzer dexter at expeedo.de
Fri Jul 17 16:44:25 HKT 2020


Derek,

all error conditions can be relevant for debugging. For example if you
need to react to some frames as fast as possible, you may want to know
if/when overflows occur, as they indicate processing delays.

Also be aware LogStatus() injects the error status into the CAN logging
framework, while ESP_LOGW() only creates a system log entry.

Again for your error codes:
> 1970-01-01 13:01:41 NZDT E (89501) can: can2: intr=93510 rxpkt=127559 txpkt=14 errflags=0x23000001 rxerr=0 txerr=0 rxovr=0 txovr=0 txdelay=0 wdgreset=0 errreset=0
> 1970-01-01 13:01:41 NZDT E (89511) can: can2: intr=93511 rxpkt=127564 txpkt=14 errflags=0x23400401 rxerr=0 txerr=0 rxovr=0 txovr=0 txdelay=0 wdgreset=0 errreset=0
> 1970-01-01 13:01:41 NZDT E (89531) can: can2: intr=93525 rxpkt=127592 txpkt=14 errflags=0x22400402 rxerr=0 txerr=0 rxovr=0 txovr=0 txdelay=0 wdgreset=0 errreset=0

The strange combination 0x2300.... (error interrupt w/o error flags) may
here also indicate a bug / race condition in the driver.

Looking at the current code now: the LogStatus() call should also be
done after having collected all error info, but the handler adds
m_status.error_flags after the call. So the picture you got might be
wrong, I suggest verifying / debugging the handler first.

Regards,
Michael


Am 17.07.20 um 09:31 schrieb Derek Caudwell:
> Thanks Michael,
>
> That explains why I was struggling to decode the error flag. Having
> been through the MCP2515 docs and decoded the logged error flags can2
> is receiving they all relate to overflow of RXB0 but not RXB1. Hence
> this does not really pose or indicate a problem for the can bus /
> MCP2515 chip, correct? 
>
> So if I have understood the chip operation is there any reason for
> line 489 in mcp2515.cpp which causes these to be logged?
>
> 489: LogStatus(CAN_LogStatus_Error);
>
> As if RXB1 does overflow and cause a packet loss then line
> 467: ESP_LOGW(TAG, "CAN Bus 2/3 receive overflow; Frame lost.");
> deals with that?
>
> Cheers Derek
>
>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev

-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20200717/2a3b2440/attachment.htm>


More information about the OvmsDev mailing list