usage of CAN ports of drive px2

I have the following questions about DRIVE PX2 CAN ports. Could any one please help me with this:

  1. When I run "ip link" command on my Drive px2 machine, I could see only can0 and can1 in the list but I could not see other ports. Why Can't I see other ports(CAN2 to CAN6)? Are they different from can0 and can1? If yes, how they are different from can0 and can1?
  2. I have written two SocketCAN programs one for sending and one for receiving CAN frames. How can I test that program using the CAN ports of DRIVE PX2?

Dear ram469,

This is DPX2 CAN ports mapping table.
That’s why you can see other CAN ports.

- can-5 -> can0 on Tegra A
- can-6 -> can1 on Tegra B
- can-1 -> channel A on Aurix
- can-2 -> channel B on Aurix
- can-3 -> channel C on Aurix
- can-4 -> channel D on Aurix

This is PCAN test example

$ sudo apt-get install can-utils
Step 1. Connected PCAN to can-5 port.
 - can-5 -> can0 on Tegra A
 - can-6 -> can1 on Tegra B
 - can-1 -> channel A on Aurix
 - can-2 -> channel B on Aurix
​ - can-3 -> channel C on Aurix
​ - can-4 -> channel D on Aurix 

Step2. Enable can0 on Tegra A.
$sudo ip link set can0 type can bitrate 500000
$sudo ip link set can0 up

Step3. Run candump
$sudo candump can0

For DriveWorks, could you please re-try below following steps?
1. In recorder-config.json file, please find "can" and change "params": "", -> "params": "device=can0".
2. $sudo ip link set can0 type can bitrate 500000
3. $sudo ip link set can0 up
4. $sudo ./recorder-qt

This is easycan setup guidance.
https://devtalk.nvidia.com/default/topic/1032296/faq/drivepx2-easycan-setup-guide/

Regarding AurixCAN, please see below.

On DRIVE PX 2 and ACR, the CAN connectors marked with CAN-1…CAN-4 are reachable throught Aurix by the Tegras. For this to work, a proper setup of the Aurix needs to be made prior to running the application. Please refer to the EasyCAN user guide provided as part of PDK documentation to set up Aurix to filter and pass a selected subset of CAN messages. In order to connect to AurixCAN, use the following arguments:

On DRIVE PX2: –driver=can.aurix –params=ip=10.42.0.83,bus=a

On ACR: –driver=can.aurix –params=ip=127.0.0.1,aport=50000,bport=50103,bus=a

Where ip is the IP address from which the CAN messages are forwarded (by default, set to 10.42.0.83) and bus points to the corresponding CAN bus connector, i.e., CAN-1->a, …, CAN-4->d.

The connection to AurixCAN happens using UDP sockets. Additional arguments for the remote (aport) and local (bport) UDP port can be specified if AurixCAN is working in a non-default configuration. By default, on DRIVE PX2, AurixCAN is reachable over aport=50000 and communicates with the Tegra over bport=60395. On ACR however, AurixCAN is reachable over aport=50000 and communicates with the Tegra over bport=50103.

Thank you so much Steve!!
Can I test my two programs(for sending and receiving) by connecting can-5 and can-6 ports(can0 on TegraA and can1 on TegraB) as a loopback So that, I can send a CAN frame from can0 and receive it from can1.

Any leads in the above workflow would be grateful, as we are not able to find exhaustive documentation and no workflows using a C or C++ implementation of CAN communication on the DRIVE PX2 board. Hope you understand our problem.