RevPI Con CAN not activating

Topics about the Hardware of Revolution Pi
Post Reply
lukesquare
Posts: 3
Joined: 30 Jun 2020, 12:06

RevPI Con CAN not activating

Post by lukesquare »

Hi, I'm trying to get the Con CAN module up and running but unfortunately without success. It's connected via ConnectBridge and the Power LED is on. However, none of the methods to enable it mentioned here (https://revolution.kunbus.de/tutorials/ ... chliessen/) are working. When I manually try to enable it I get the following error:

Code: Select all

pi@RevPi37535:~ $ sudo revpi-config enable revpi-con-can
* Failed to apply overlay '0_revpi-con-can' (kernel)
1
Resetting the driver via PiCtory shows some errors:

Code: Select all

[  439.254141] piControl: Reset: BridgeState=2
[  439.322462] piControl: stop data exchange
[  439.322497] piControl: piIoComm_gotoGateProtocol returned 0
[  439.322984] piControl: kernel_read returned 0: b7252200, 1582
[  439.323008] piControl: 2 devices found
[  439.323013] piControl: 8 entries in total
[  439.323040] piControl: cl-comp:  0 addr  6  bit ff  len   8
[  439.323254] piControl: RevPiDevice_init()
[  439.323277] piControl: PADS 0 = 0x1b   slew=1  hyst=1  drive=3
[  439.323281] piControl: PADS 1 = 0x1b   slew=1  hyst=1  drive=3
[  439.323287] piControl: PADS 2 = 0x1b   slew=1  hyst=1  drive=3
[  439.323609] piControl: Enter Init State
[  439.324140] piControl: Enter PresentSignalling1 State
[  439.363168] piControl: Enter InitialSlaveDetectionRight State
[  439.363697] piControl: Enter InitialSlaveDetectionLeft State
[  439.364228] piControl: Enter ConfigLeftStart State
[  439.374043] piControl: Enter ConfigDialogueLeft State
[  439.375013] piControl: wrong cmd code in response
[  439.412450] piControl: piIoComm_sendRS485Tel(GetDeviceInfo) failed 5
[  439.413940] piControl: wrong cmd code in response
[  439.442429] piControl: piIoComm_sendRS485Tel(GetDeviceInfo) failed 5
[  439.443912] piControl: wrong cmd code in response
[  439.482430] piControl: piIoComm_sendRS485Tel(GetDeviceInfo) failed 5
[  439.483910] piControl: wrong cmd code in response
[  439.512434] piControl: piIoComm_sendRS485Tel(GetDeviceInfo) failed 5
[  439.512966] piControl: Enter EndOfConfig State

[  439.512974] piControl: Device  0: Addr  0 Type  95  Act 1  In   6 Out   5
[  439.512979] piControl:            input offset      0  len   6
[  439.512984] piControl:            output offset     6  len   5
[  439.512989] piControl:            serial number 1  version 1.2
[  439.512993] piControl:
[  439.513004] piControl: Adjust: base 0 in 0 out 6 conf 0
[  439.513010] piControl: After Adjustment
[  439.513016] piControl: Device  0: Addr  0 Type  95  Act 1  In   6 Out   5
[  439.513021] piControl:            input offset      0  len   6
[  439.513025] piControl:            output offset     6  len   5
[  439.513031] piControl: Device  1: Addr 32 Type 109  Act 1  In   0 Out   0
[  439.513036] piControl:            input offset      0  len   0
[  439.513041] piControl:            output offset     0  len   0
[  439.513044] piControl:
[  439.632425] piControl: start data exchange
[  439.872430] piControl: set BridgeState to running
Any help would be greatly appreciated!!!
User avatar
lukas
Expert
Posts: 186
Joined: 13 Feb 2017, 10:29

Re: RevPI Con CAN not activating

Post by lukas »

The Con CAN module isn't handled by piControl. Rather, you should see a device "can0" when invoking "ifconfig -a".

The can0 interface is instantiated by the driver for the CAN chip (hi3110). The CAN chip is attached to the SPI bus spi0. revpi-config adds an entry "dtoverlay=revpi-con-can" to /boot/config.txt which adds the CAN chip to the spi0 bus on the next reboot. Additionally, it loads the devicetree overlay at runtime.

Did you get any errors in dmesg regarding spi0 or hi3110? Can you see the can0 device after rebooting? Which kernel version are you using, i.e. what does "uname -a" say? Please provide full dmesg output so that we can analyze what's going on. Thanks.
lukesquare
Posts: 3
Joined: 30 Jun 2020, 12:06

Re: RevPI Con CAN not activating

Post by lukesquare »

Thanks for the response. There is no can0 interface available, just a piright one:

Code: Select all

piright: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether ca:ea:a2:49:68:f9  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
There are hi3110 errors reported in dmesg:

Code: Select all

[    4.149366] CAN device driver interface
[    4.208709] ks8851 spi0.1 piright: renamed from pieth0
[    4.215461] hi3110 spi0.0: Cannot initialize 3110. Wrong wiring?
[    4.215487] hi3110 spi0.0: Probe failed, err=19
Any ideas?

Kernel version:

Code: Select all

pi@RevPi37535:~ $ uname -a
Linux RevPi37535 4.19.95-rt38-v7+ #1 SMP PREEMPT RT Tue, 16 Jun 2020 13:25:43 +0200 armv7l GNU/Linux
Thank you!
User avatar
lukas
Expert
Posts: 186
Joined: 13 Feb 2017, 10:29

Re: RevPI Con CAN not activating

Post by lukas »

The piright interface should only be present on a RevPi Core. The Connect has a pileft but no piright.

Do you have a RevPi Core or a Connect? The Con CAN can only be used with the Connect.

If you've got a Connect, check that there's a line "dtoverlay=revpi-connect" in /boot/config.txt.
The existence of the piright interface suggests that you may have an erroneous "dtoverlay=revpi-core" entry in that file.
lukesquare
Posts: 3
Joined: 30 Jun 2020, 12:06

Re: RevPI Con CAN not activating

Post by lukesquare »

I have a Core 3+, I didn't know the Con CAN is only usable with the Connect. Now on order...

What about the CANopen gateway? Can that be used with a RevPi Core?
User avatar
lukas
Expert
Posts: 186
Joined: 13 Feb 2017, 10:29

Re: RevPI Con CAN not activating

Post by lukas »

The PiBridge and ConBridge sockets have slightly different shapes. (The edges are different.) This is intended to prevent use of ConBridge modules on the PiBridge. You may have damaged the ConBridge plug slightly when forcing it into the PiBridge socket. Hopefully the Con CAN module wasn't damaged.

Yes the CANopen gateway can be used on the Core (on either side) as well as on the Connect (on the left side, i.e. PiBridge side). However its usage is completely different vis-a-vis the Con CAN module:

With the Con CAN module you get a can0 interface that you can access from Linux user space using the SocketCAN API and utilities such as cansend and candump:
https://en.wikipedia.org/wiki/SocketCAN

The CANopen gateway on the other hand reads from and writes data to the piControl process image:
https://revolution.kunbus.com/tutorials ... e-canopen/
Post Reply