I am probing PIN 31 and Ground and PIN 29 and Ground, but not seeing any signals between the XAVIER and the Transciever. Makes me think something isn’t enabled.
According to the forums, there are two methods to enable CAN: 1. Flash it, 2: change the registers on each boot.
I have done the 2nd method and have not seen any signals from the Xavier.
So, I started tracing my steps and started from the beginning because I have to believe that the interface on the Xavier AGX dev kit works.
So, with the scope connected i went to enable the registers for CAN and started with the loop back.
Question, it doesn’t appear to have to actually be physically connected for the loopback to work? The driver can listen to itself? So, removed the jumper for CAN RX and CAN TX but sent some messages to the CAN Transciever, and saw some data go across the bus. WOOHOO!!
I also switched some things on my transceiver, like using the interface that was actually connected. HA! But it appears that maybe my transceiver was acting up, but the CAN H and CAN L were showing some transmissions but the data was way bad and noisy. So, I am ordering some new transceivers to make sure it was me.
I will provide update once complete.
Everytime you wanna start using the CAN on Jetson, do configure it everytime with something like
sudo ip link set down can1
sudo ip link set down can0
sudo busybox devmem 0x0c303000
sudo busybox devmem 0x0c303010
sudo busybox devmem 0x0c303008
sudo busybox devmem 0x0c303000 32 0x0000C400
sudo busybox devmem 0x0c303008 32 0x0000C458
sudo busybox devmem 0x0c303010 32 0x0000C400
sudo busybox devmem 0x0c303018 32 0x0000C458
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 up type can bitrate 250000 sjw 127 dbitrate 2000000 dsjw 15 berr-reporting on fd on
sudo ip link set can1 up type can bitrate 250000 sjw 127 dbitrate 2000000 dsjw 15 berr-reporting on fd on
sudo ip link set up can0
sudo ip link set up can1
ip -s -d link show can0
ip -s -d link show can1
The magic here is:sudo ip link set can0 up type can bitrate 250000 sjw 127 dbitrate 2000000 dsjw 15 berr-reporting on fd on… this was what saved me from ever-lasting troubles. Do read on it.
I’m pretty sure I had a quality transformer just might have been bad luck with this particular one. I’ve ordered more to be sure. This is the one I used: Copper hill tech isolated 3v3 can bus transceiver.
I thought I followed those steps every time but not sure since it didn’t work and now it seems. Going to try again today to make sure I get to the same point to verify Xavier is setup correctly but gonna be a couple of days until parts arrive.
Alright, 100% user error with the transceiver. I had to solder the jumper for the 120Ohm resistor. I know, i know, you gotta terminate the ends.
As for the rest, i am not sure, but seems that following your steps and the steps from the medium article and from the github seem to work great now! so strange. i was definitely getting some errors initially, but i can successfully recreate and send CAN messages.
So, thanks a ton for the assist and reminder, all is working now!