CAN bus problems

Hello,

I have used PeakCan to test the Canbus sample.
There are 6 channel CAN and three CAN connector. I suppose that
can-1 -------> channel A on Aurix
can-2 -------> can0 on Xavier A/B
can-6 -------> can1 on Xavier A/B

Connecting PeakCan to CAN1&2 connector directly, canbus sample using AurixCan can send CAN msgs but can’t receive any msg.

./sample_canbus_logger --driver=can.aurix --params=ip=10.42.0.146,bus=a,config-file=/path/to/EasyCanConfigFile.conf --send_i_understand_implications=100

Connecting PeakCan to Can6&4 connector directly, canbus sample using SocketCan can’t send or receive any CAN msg.

./sample_canbus_logger --driver=can.socket --params=device=can1 --send_i_understand_implications=100

I wonder how can I make them work. Thank you.

Dear dong.liang,
Could you share the DRIVE SW version?

Hi

The DRIVE SW version is 9.0. Thank you!

Dear dong.liang,

Did you setup CAN HW for the sample like below?

sudo ip link set can0 type can bitrate 500000
sudo ip link set can0 up

Could you please refer to the sample guidance in DriveWorks doc?

Hello Steve,

Yes, I have followed the sample guidance and setup can0/can1 as you said.
But I can’t receive/send any message.

Hello, the aurix CAN still have problems on CAN_message receiving (Is it cause by the Error"Cannot setup CAN message filters: DW_NOT_SUPPORTED"?), and I have confirmed on my PeakCAN that CAN_message sending of aurix CAN is working fine.

I ran the aurix_configure_easy_can.py(copy from folder /DRIVE-V5.1.0-E3550-Aurix of my hostPC) on Xavier first and then I tried the canbus sample shown below, but I still can’t make it work. My Drive SW version is 9.0. I would be grateful if you can give some advice. Thank you.

./sample_canbus_logger --driver=can.aurix --params=ip=10.42.0.146,bus=a,config-file=/home/nvidia/drive-t186ref-linux/samples/easycan/EasyCanConfigFile.conf --filter=000:000 --send_i_understand_implications=100
Program Arguments:
--driver=can.aurix
--filter=000:000
--offscreen=0
--params=ip=10.42.0.146,bus=a,config-file=/home/nvidia/drive-t186ref-linux/samples/easycan/EasyCanConfigFile.conf
--profiling=1
--send_i_understand_implications=100
--send_id=6FF

[04-07-2017 08:21:04] Platform: Detected DDPX - Tegra A
[04-07-2017 08:21:04] Initialize DriveWorks SDK v2.0.2081
[04-07-2017 08:21:04] Release build with GNU 4.9.4 from heads/buildbrain-branch-0-g36b127f against Drive PDK v5.1.0.2
[04-07-2017 08:21:04] TimeSource: monotonic epoch time offset is 1499153892175768
[04-07-2017 08:21:04] PTP Time is available from NVPPS Driver
[04-07-2017 08:21:05] Platform: number of GPU devices detected 1
[04-07-2017 08:21:05] Platform: currently selected GPU device integrated ID 0
[04-07-2017 08:21:05] SDK: Resources mounted from /usr/local/driveworks-2.0/data/
[04-07-2017 08:21:05] SDK: Create NvMediaDevice
[04-07-2017 08:21:05] egl::Display: found 1 EGL devices
[04-07-2017 08:21:05] egl::Display: use drm device: drm-nvdc
[04-07-2017 08:21:05] SensorFactory::createSensor() -> can.aurix, ip=10.42.0.146,bus=a,config-file=/home/nvidia/drive-t186ref-linux/samples/easycan/EasyCanConfigFile.conf
Cannot setup CAN message filters: DW_NOT_SUPPORTED
[04-07-2017 08:21:05] EndpointUDP: started 10.42.0.146:50000

Dear dong.liang,

I think this issue is related to Aurix part.
So could you please contact Eletrobit team? I will send a PM, please check the message. Thanks.

Hi Steve,

I cannot send and receive messages from Socket CAN1 either.

I connected the CAN6&4 cable to my PeakCAN (I connected CAN1&2 cable to my PeakCAN when I used can.aurix)
and followed the step as below. But no message came to the PeakCAN.

sudo ip link set can1 down
sudo ip link set can1 type can bitrate 500000
sudo ip link set can1 up
./sample_canbus_logger --driver=can.socket --params=device=can1 --send_i_understand_implications=1000

Program Arguments:
--driver=can.socket
--filter=000:000
--offscreen=0
--params=device=can1
--profiling=1
--send_i_understand_implications=1000
--send_id=6FF

[04-07-2017 13:29:23] Platform: Detected DDPX - Tegra A
[04-07-2017 13:29:23] Initialize DriveWorks SDK v2.0.2081
[04-07-2017 13:29:23] Release build with GNU 4.9.4 from heads/buildbrain-branch-0-g36b127f against Drive PDK v5.1.0.2
[04-07-2017 13:29:23] TimeSource: monotonic epoch time offset is 1499153892109447
[04-07-2017 13:29:23] PTP Time is available from NVPPS Driver
[04-07-2017 13:29:25] Platform: number of GPU devices detected 1
[04-07-2017 13:29:25] Platform: currently selected GPU device integrated ID 0
[04-07-2017 13:29:25] SDK: Resources mounted from /usr/local/driveworks-2.0/data/
[04-07-2017 13:29:25] SDK: Create NvMediaDevice
[04-07-2017 13:29:25] egl::Display: found 1 EGL devices
[04-07-2017 13:29:25] egl::Display: use drm device: drm-nvdc
[04-07-2017 13:29:25] SensorFactory::createSensor() -> can.socket, device=can1
[04-07-2017 13:29:25] CANSocket: use SW based timestamps for can1
[04-07-2017 13:29:25] CANSocket: started can1

and ifconfig result is

can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          UP RUNNING NOARP  MTU:16  Metric:1
          RX packets:2 errors:2 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10 
          RX bytes:16 (16.0 B)  TX bytes:0 (0.0 B)
          Interrupt:106 

can1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          UP NOARP  MTU:16  Metric:1
          RX packets:6 errors:3 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10 
          RX bytes:48 (48.0 B)  TX bytes:0 (0.0 B)
          Interrupt:107

Hi Steve,

I got no contact from EB.
And the CAN channel is still not working.
Really need some help to make it work.

For SW 9.0, is it necessary to use the command modprobe mttcan and modprobe mttcan_ivc to make the socket CAN work?
I loaded mttcan module successfully but failed on the mttcan_ivc module with error message as below.

modprobe: FATAL: Module mttcan_ivc not found in directory /lib/modules/4.9.131-rt93-tegra

Thank you.

Dear dong.liang,

I thinks the job should work.
[url]https://docs.nvidia.com/drive/active/5.1.0.2L/nvvib_docs/index.html#page/DRIVE_OS_Linux_SDK_Development_Guide%2FInterfaces%2FAppxTegraCAN.html%23wwpID0E0MG0HA[/url]

Could you please file a bug for this topic?
Please share bug ID, we will look into this issue.
Please login to https://developer.nvidia.com/drive with your credentials. Please check MyAccount->MyBugs->Submit a new bug to file bug. Thanks.