Hi, I am trying to use control area network on Jetson orin NX. I try the commands given in below link but it is not working. I am using DSO to see the output. I put dso prob on the TX of CAN but no out put only high signal on CAN TX (On the CAN connector ). Please also tell about the register memory location given in link. I am not able to find them in TRM.
Hello,
Welcome to the NVIDIA Developer forums! Your topic will be best served in the Jetson category.
I will move this post over for visibility.
Cheers,
Tom
Hi skhanna.esys,
Are you using the devkit or custom board for Orin NX?
What’s your Jetpack version in use?
Do you use the CAN transceiver in your case?
Have you configured the pinmux before use?
Please share the result of the following commands on your board.
$ sudo busybox devmem 0x0c303018
$ sudo busybox devmem 0x0c303010
I am using Seeed Studio Orin board.
1.Do you use the CAN transceiver in your case?–No at present just I want to check the frame is coming on TX pin. I am using DSO to check waveform on pin directly but there is no output.
-
Have you configured the pinmux before use?-- In seed studio document and in link I shared in my last post, it is given that these pin are for CAN. So I did not configure it.
-
For “sudo busybox devmem 0x0c303018” command I am getting “0x0000C450”.
For " sudo busybox devmem 0x0c303010" i am getting “0x0000C400” -
What’s your Jetpack version in use?-- I am sorry I don’t know how to check it.
And I try every step given in below link–
Controller Area Network (CAN) — Jetson Linux Developer Guide documentation.
And my board in new so I don’t think it is an hardware issue.
Please share the result of the following command on your board.
$ cat /etc/nv_tegra_release
I would suggest you connect the CAN transceiver to get it work.
CAN interface would need the CAN transceiver to transform data from CAN-TX/CAN-RX to CAN-H/CAN-L.
I got this response–
R35 (release), REVISION: 4.1, GCID: 33958178, BOARD: t186ref, EABI: aarch64, DATE: Tue Aug 1 19:57:35 UTC 2023.
I connect the transceiver but result is same, there is no output
Hi, I also check the loop back mode of CAN 0. I use the following command and this work.
sudo modprobe can
sudo modprobe can_raw
sudo modprobe modprobe mttcan
sudo ip link set can0 type can bitrate 500000 loopback on
sudo ip link set can0 up
sudo candump can0 &
sudo cansend can0 123#abcdabcd
Now to get frame on CAN Bus I am trying these commands but this is not working and there is no output on CAN bus.
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
sudo cansend can0 123#abcdabcd
Hi, Please help how to solve this issue…
It seems the internal loopback test working in your case, which means the pinmux and the configurations for CAN interface should be fine.
Please remove fd on
in this command to verify.
May I know the block diagram of your connections currently?
Hi, I try the following steps…
udo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 up type can bitrate 500000 dbitrate 1000000 berr-reporting on
But after this, I am getting this —“RTNETLINK answers: Operation not supported”
And I am using same connection as given on site. But also checking using DSO.
I connect the CAN transceiver on the J16 CAN header of seeed carrier board, reComputer J401
Hi, Please respond
Are you connecting 2 Orin NX for CAN communication?
Please also share the full dmesg for further check.
No, I am using CAN transceiver and CAN bus to USB converter to monitor the frame and I am using DSO also and these is no waveform/output on CAN TX of orin. My circuit is correct I don’t have any doubt on this because I use same with STM32 microcontroller and it work properly
Your connection looks good to me.
Have you configured the same data rate/bit rate for CAN at both sides(Orin and PC)
Please also share the full dmesg.
Hi, I try these commands and now I am getting output but it is not correct and one more problem I face is that when output on CAN bus is stopped then I can not restart it. I need to restart board and again give the commands. So please give me correct script for same.
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set down can0
sudo ip link set can0 type can bitrate 500000
sudo ip link set can0 up
sudo candump can0 &
cangen can0 -g 400 -I 42A -L 1 -D i -v -v
The command suggest by you
“sudo ip link set can0 up type can bitrate 500000 dbitrate 1000000 berr-reporting on” give this message --“RTNETLINK answers: Operation not supported”
If there us any C code or Python code then please share. Finally I need to use CAN Bus in my application which is written in C and Python. I have “jetgpio,h”. It work for I2C and UART but nothing for CAN bus.
The bitrate is 500000 and I am using CAN stranded. But as I said the wave form are not look right on DSO and if I stop the data generation it not start again. To start again I need to restart the Orin.
These commands worked for us for CAN in our earlier project Jetson AGX Xavier Industrial on Release 35.4.1. See if it helps you in anyways
#!/bin/bash
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 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
sudo ip link set can1 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
sudo ip link set up can0
sudo ip link set up can1exit 0
ok I am checking it. But any python code or C code for CAN BUS?
Hi, I tested your script. It generate signal but after some time it stop. On shell it is working but no message is coming and no waveform on DSO. I modify your script also. But there is no effect. To start the CAN output again I need to restart the orin and then run script again.
#!/bin/bash
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 down can0
sudo ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
sudo ip link set up can0
sudo ifconfig can0 txqueuelen 1000
cangen can0 -g 400 -I 42A -L 1 -D i -v -v
exit 0
I use “ipconfig” and I am getting this …
can0: flags=129<UP,NOARP> mtu 72
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
RX packets 286053 bytes 2288424 (2.2 MB)
RX errors 286050 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 108
There is no CAN1 up in your commands below