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. https://docs.nvidia.com/drive/nvvib_docs/index.html#page/NVIDIA%20DRIVE%20Linux%20SDK%20Development%20Guide%2FAppendix%2FAppxTegraCAN.html%23wwpID0E0UC0HA
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
Initialize DriveWorks SDK v0.6.67
Release build with GNU 4.9.2 from v0.6.0-rc7-0-g51bd3aa against Vibrante PDK v188.8.131.52
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:
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?