can-bussocketcan

SocketCAN error-passive with RevPi CAN Connect. Hardware or Software issue?


We have bought a CAN Connect module for our Revpi Connect, and set it up as can been seen in this thread on the Kunbus forum. As far as we understand this will provide the proper termination.

We have also followed this guide provided by Revolution PI.

When checking that the drivers for the CAN module is properly loaded, everything looks fine:

$ dmesg | grep can
[    4.616900] hi3110 spi0.0 can0: 3110 successfully initialized.
[  107.049422] IPv6: ADDRCONF(NETDEV_UP): can0: link is not ready
[  107.049463] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready

Checking ip statistics gives this result:

$ ip -det -statistics link show can0
5: can0:  mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can  promiscuity 0
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
          bitrate 50000 sample-point 0.875
          tq 1250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
          hi3110: tseg1 2..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
          clock 16000000
          re-started bus-errors arbit-lost error-warn error-pass bus-off
          0          0          0          0          0          0         numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
    RX: bytes  packets  errors  dropped overrun mcast
    0          0        0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    0          0        0       0       0       0

However, when we turn on candump and send a message using cansend, candump does not show any traffic.

If we check dmesg for CAN again, we get this result:

$ dmesg | grep can
[    4.616900] hi3110 spi0.0 can0: 3110 successfully initialized.
[  107.049422] IPv6: ADDRCONF(NETDEV_UP): can0: link is not ready
[  107.049463] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[  292.285353] can: controller area network core (rev 20170425 abi 9)
[  292.297811] can: raw protocol (rev 20170425)

And if we check ip -statistics again, we can see that the state of the connection has gone into ERROR-PASSIVE:

$ ip -det -statistics link show can0
5: can0:  mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can  promiscuity 0
    can state ERROR-PASSIVE (berr-counter tx 128 rx 0) restart-ms 0
          bitrate 50000 sample-point 0.875
          tq 1250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
          hi3110: tseg1 2..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
          clock 16000000
          re-started bus-errors arbit-lost error-warn error-pass bus-off
          0          0          0          1          1          0         numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
    RX: bytes  packets  errors  dropped overrun mcast
    0          0        0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    0          0        0       0       0       0

We are trying to communicate with a computer with and Ixxat USB2CAN v2, at 50kbps, with both highspeed and FT settings, but nothing seems to work. Resetting the connection, seems to put it back into ERROR-ACTIVE state.

When trying to communicate with mentioned computer, using another computer with Socketcan and another Ixxat USB2CAN v2 device, everything works fine.

I should perhaps also mention that if we turn loopback on, we can see the messages we are sending.

We are struggling to understand whether this a hardware or software error. Is our termination in order? Are there any magical settings in SocketCAN we have overlooked? Where should we start debugging this issue?

Any help would be greatly appreciated.


Solution

  • As it turns out, the schematic printed directly on the device is wrong.The schematic on their website is correct.

    Image of schematic on CAN connect

    Hopefully this can help someone else avoid pulling their hair out in the future.