At least 4 can registers (can1 data in, data out, can2 data in, data out) need to be changed to configure as SFIO. Since WAKE and STANDBY are not supported currently they can be ignored.
Remove the entries under GPIO settings in the pinmux file (somewhere at beginning of the file)
Change the configurations as below in the same file (These settings can be found down in the file)
0x0c303000 = 0x0000c400;
0x0c303008 = 0x0000c458;
0x0c303010 = 0x0000c400;
0x0c303018 = 0x0000c458;
The values can be matched as per Tegra register manual.
I’m pretty limited in this area but I have LPMS-CANAL2 IMU sensor (9-Axis Waterproof IMU LPMS-AL2 Series - LP-RESEARCH) that has CAN bus communication interface. I am going to read the IMU data stream using Jetson Xavier. I got a CAN transceiver (Amazon.com) and I did the hardware setup based on (GitHub - hmxf/can_xavier: CAN Bus Drive Script) and passed the test CAN0 controller(loopback test) based on that website and I also got CAN0 when run ‘ifconfig’. BUT, I can get results only in the loopback test mode not in the normal mode (I do not know why!).
Anyway, My Sensor has 4 wires (GND, VCC, and CAN+ and CAN-). GND and VCC are connected to external DC voltage supplier. I think CAN+ and CAN- are connected to CAN-H and CAN-L of the transceiver respectively. But how do I know my sensor is connecting or communicating with the Xavier? Is there any IP or ID address that can get in the terminal to make sure that my sensor is connected to the Xavier. I would appreciate if you can help me soon. Thanks so much.
If you’ve already enabled CAN on your Xavier and the IMU device is properly connected to the CAN bus, you can simply use the following command in terminal to check if you’re receiving CAN traffic:
Thanks Ramin for your reply. I actually did but I am not seeing anything. Is it possible that the bitrate that I setup is not compatible with the sensor? I used this ‘sudo ip link set can0 type can bitrate 1000000’
Here is what I found in the user manual of the sensor
“The CAN message uses standard 11 bits identifier and 8 bytes of data.
The default connection baud rate is 125Kbit/s.”
Also here is a copy of quick user manual of the sensor (https://www.lp-research.com/wp-content/uploads/2017/11/LpmsCanal2QuickStartGuide20171027.pdf)
I did what you said but still nothing comes up when I do ‘candump can0’
I also check the hardware setup multiple time and I am pretty sure the wiring is correct.
As far as I know, Jetson has two CAN bus terminals CAN0 and CAN1. Is it possible to use only one CAN bus (CAN0) with multiple sensor entries? For example, assume I have two IMUs and I am going to connect them to CAN0 only. I think the hardware setup would be as follows
All the IMUs Rx are connected to Jetson Rx and similarly all the IMU Tx are connected to Jetson Tx.
But how can I assign a specific ID to each IMU CAN? For example, when I run “candump can0”, how to see what data come from which sensor?
You can join as many sensors as you want to one can port (CAN0), but everyone (read and send) on CAN0 has to have the same baudrate.
Regarding CAN id of devices, unless you can have access directly to the IMU firmware somehow to set it, this information is usually set by default by the manufacturer (should include in the device manual or info on their webpage). Some device may automatically claim a different address if the default address is already claimed on the bus, but best is to read the sensor manual to know this information.
hello,
i followed this topic and the github readme referred earlier, but i got no success on loading the can drivers.
i got the following error:
insmod: ERROR: could not insert module /lib/modules/4.9.108-tegra/kernel/drivers/net/can/can-dev.ko: Invalid module format
or:
nvidia@jetson-0423418010460:~$ sudo modprobe can
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.9.108-kastner/modules.dep.bin'
modprobe: FATAL: Module can not found in directory /lib/modules/4.9.108-kastner
can you please give me some hints?
Linux jetson-0423418010460 4.9.108-kastner #3 SMP PREEMPT Thu Jul 11 15:22:26 CEST 2019 aarch64 aarch64 aarch64 GNU/Linux
I bumped into this question while trying to figure out how to connect Custom IMU to Driveworks. I am trying to connect the IMU_CAN interface and run ./sample_can_interpreter using a real CAN device.
My problem is I am using slcand and not able to configure it right. The transceiver I am using is CANalyst-ii which is USB-CAN. Usb connecting to the host. This device doesn’t have documentation to work with linux but from other online resources (mainly this link: CANalyst II - dankwiki, the wiki of nick black) I got to the point where I can see slcan0 when in ifconfig.
When i do candump slcan0, i see the cursor blinking and not printing anything. I am prety sure CAN IMU is sending out data. Because I am able to do the candump can0 in my raspberrypi (using pyCAN board there). Maybe this is a bit rate issue. CAN device baudrate is 250000.
I used following commands to get this far,
Trying to get candump work in my Rpi before I make it work with DriveWorks.
Maybe this is not the right thread to post this but clearly you guys know more than I thought posting here might help. Let me know if you want me to create a new post.
Thanks in advence.
Hello all,
I am trying to enable can on Xavier , CAN on Xavier send data and received by another can controller ,but when the other controller send me nothing recieved by the CAN on Xavier .
Could any one help?
hi, spatra, I found a serious issue. CAN-BUS function enable successfully only when I use JetPack4.4, I try to flash JetPack4.5 or higher version, it can’t be used
I have the same problem related to CAN and various JetPack versions.
It is also working for me with JetPack version 4.4 but does not work under JetPack 4.5.1.
Did you found some sort of solution for this issue?