CANbus Interpreter Sample with CAN0 with 1Mbps


I have been trying to operate the driverworks-0.6/samples/src/sensors/canbus/interpreter example using a real CAN device, a Delphi ESR. I have the Delphi ESR on CAN0 on Tegra A (labeled CAN E on my vehicle harness).

I have been following this link to make sure my driver is correct. I want the mttcan driver, not mttcan-ivc because I need the bitrate to be 1Mbps because the ESR i have operates at that rate. this link claims mttcan supports 1Mbps.

lsmod showed that mttcan was being used out of the box. I further verified this in the device tree by finding the status of mttcan to be “okay” and mttcan-ivc to be “disabled”

I then configured my can0 connection as follows:
sudo ip link set can0 type can bitrate 1000000
sudo ip link set can0 up

Then executed it as follows with output:
nvidia@nvidia:/usr/local/driveworks-0.6/bin$ sudo ./sample_canbus_interpreter --dbc=/home/nvidia/Downloads/128_ESR_Detections_v2p1_rev5.dbc --driver=can.socket --params=device=can0
Program Arguments:

Initialize DriveWorks SDK v0.6.67
Release build with GNU 4.9.2 from v0.6.0-rc7-0-g51bd3aa against Vibrante PDK v5.0.5.0
TimeSource: monotonic epoch time offset is 1520496893793503
TimeSource: PTP ioctl returned error. Synchronized time will not be available.
TimeSource: Could not detect valid PTP time source at ‘eth0’. Fallback to CLOCK_MONOTONIC.
SDK: Resources mounted from /usr/local/driveworks-0.6/data/resources
nvrm_gpu: Bug 200215060 workaround enabled.
SDK: Create NvMediaDevice
egl::Display: found 2 EGL devices
egl::Display: use drm device: drm-nvdc
SDK: number of GPU devices detected 2
SDK: currently selected GPU device discrete ID 0
SAL: identified board as DrivePX2-TegraA
SensorFactory::createSensor() -> can.socket, device=can0
Create DBC-based CAN message interpreter
CAN DBC parser: Discard message info: Size 0, ID: 4294967295

CAN DBC parsed results:
numMessages: 183
numSignals: 1237
numSignalsExtendedValueType: 0
numInvalidMessages: 33
numInvalidSignals: 14
numInvalidSignalsExtendedValueType: 0

CANSocket: ioctl(SIOCSHWTSTAMP, can0) failed -> Bad address. Cannot enable HW timestamps, try with root user.
CANSocket: use SW based timestamps for can0
CANSocket: started can0

The output says “started can0” but there is no further output saying whether data is being read. The sensor is outputing data at this point, so im not sure how to get the interpreter to see it.
Does CAN0 include an internal terminating resistor? Is so what size?
Is this sample operable at 1Mbps? The example is for 500000.
What else can i do to test this sensor using the PX2?


Make sure you have CAN E on the Aurix MCU also set to 1 Mbps. You can do that by typing

cansetbr e 1000

in the Aurix console (I get to the console through the USB 2.0 port and an A-to-A cable). The CAN E connection is shared with Tegra A (CAN0) and the Aurix MCU, so they must match bitrates or they will interfere with each other. By default the Aurix CAN interface is set to 500 Kbps. You should only need to change it once since the settings now persist across power loss.

Per, you better use the latest PDK( and Aurix FW(4.02.04) of DrivePX2.