Apollo: How to test canbus module with ESD CAN card

Created on 9 Apr 2019  ·  3Comments  ·  Source: ApolloAuto/apollo

When I run cyber_launch start modules/canbus/launch/canbus.launch I get following error:
image

Running ls /dev/can* shows the can devices.
Also lspci -tv shows ESD card - +-1b.0-[02]----00.0 ESD Electronic System Design GmbH Device 0402

How can I test if the can drivers are working for Apollo?

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 14.04): 14.04.3
  • Apollo installed from (source or binary): Docker
  • Apollo version (1.0, 1.5, 2.0, 2.5, 3.0): 3.5
Canbus Help wanted

Most helpful comment

Regarding your question how you could verify that the esd can drivers are working properly, we would propose the following steps:

a. Confirm that the kernel module is loaded, use
lsmod | grep esdcan

The loaded module esdcan_pcie402 should show up like this:

user@host:~$ lsmod | grep esdcan
esdcan_pcie402        106496  0

b. Check that the device nodes /dev/can* are present. Please add the output of
“ls –l /dev/can*”
to your next report. It should look like this:

user@host:~$ ls -l /dev/can*
crw-rw-rw- 1 root root 52, 0 Apr 16 13:01 /dev/can0
crw-rw-rw- 1 root root 52, 1 Apr 16 13:01 /dev/can1

c. If the device nodes are present, please use the cantest tool which is provided here:
https://github.com/ApolloAuto/apollo-contrib/tree/master/esd/bin64
to display what can interfaces are seen by an application that uses the libntcan library.

The output of “cantest -2” should look like this:

user@host:~$ cantest -2
CAN Test Rev 3.0.7  -- (c) 1997 - 2018 esd electronics gmbh

Available CAN-Devices:
Net   0: ID=CAN_PCIE402 (2 ports) Serial no.: GA000128
         Versions (hex): Lib=4.1.04 Drv=3.A.07 HW=1.0.16 FW=0.0.47 (0.0.00)
         Baudrate=7fffffff (Not set) Status=0000 Features=00000ffa
         Ctrl=esd Advanced CAN Core @ 80 MHz (Error Active / REC:0 / TEC:0)
         Transceiver=TI SN65HVD251
         TimestampFreq=80.000000 MHz Timestamp=000000B9F97F00F6
Net   1: ID=CAN_PCIE402 (2 ports) Serial no.: GA000128
         Versions (hex): Lib=4.1.04 Drv=3.A.07 HW=1.0.16 FW=0.0.47 (0.0.00)
         Baudrate=7fffffff (Not set) Status=0000 Features=00000ffa
         Ctrl=esd Advanced CAN Core @ 80 MHz (Error Active / REC:0 / TEC:0)
         Transceiver=TI SN65HVD251
         TimestampFreq=80.000000 MHz Timestamp=000000B9F97F1AE6

As you can see here the CAN networks 0 and 1 are available.

Hopefully this helps.

All 3 comments

you should install a esdcan-pcie402 driver and add a library in third_party/can_card_library. Most time,it would work.

Regarding your question how you could verify that the esd can drivers are working properly, we would propose the following steps:

a. Confirm that the kernel module is loaded, use
lsmod | grep esdcan

The loaded module esdcan_pcie402 should show up like this:

user@host:~$ lsmod | grep esdcan
esdcan_pcie402        106496  0

b. Check that the device nodes /dev/can* are present. Please add the output of
“ls –l /dev/can*”
to your next report. It should look like this:

user@host:~$ ls -l /dev/can*
crw-rw-rw- 1 root root 52, 0 Apr 16 13:01 /dev/can0
crw-rw-rw- 1 root root 52, 1 Apr 16 13:01 /dev/can1

c. If the device nodes are present, please use the cantest tool which is provided here:
https://github.com/ApolloAuto/apollo-contrib/tree/master/esd/bin64
to display what can interfaces are seen by an application that uses the libntcan library.

The output of “cantest -2” should look like this:

user@host:~$ cantest -2
CAN Test Rev 3.0.7  -- (c) 1997 - 2018 esd electronics gmbh

Available CAN-Devices:
Net   0: ID=CAN_PCIE402 (2 ports) Serial no.: GA000128
         Versions (hex): Lib=4.1.04 Drv=3.A.07 HW=1.0.16 FW=0.0.47 (0.0.00)
         Baudrate=7fffffff (Not set) Status=0000 Features=00000ffa
         Ctrl=esd Advanced CAN Core @ 80 MHz (Error Active / REC:0 / TEC:0)
         Transceiver=TI SN65HVD251
         TimestampFreq=80.000000 MHz Timestamp=000000B9F97F00F6
Net   1: ID=CAN_PCIE402 (2 ports) Serial no.: GA000128
         Versions (hex): Lib=4.1.04 Drv=3.A.07 HW=1.0.16 FW=0.0.47 (0.0.00)
         Baudrate=7fffffff (Not set) Status=0000 Features=00000ffa
         Ctrl=esd Advanced CAN Core @ 80 MHz (Error Active / REC:0 / TEC:0)
         Transceiver=TI SN65HVD251
         TimestampFreq=80.000000 MHz Timestamp=000000B9F97F1AE6

As you can see here the CAN networks 0 and 1 are available.

Hopefully this helps.

Closing this issue as it appears to be resolved. Feel free to reopen if you have any additional questions. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahuer2435 picture ahuer2435  ·  3Comments

zmsunnyday picture zmsunnyday  ·  3Comments

CCodie picture CCodie  ·  3Comments

chasingw picture chasingw  ·  3Comments

Wsine picture Wsine  ·  3Comments