Orin jp5.0.2 can-bus

HI,ALL.
My Orin can bus is similar to Orin CAN Bus can`t work web URL. Use an oscilloscope to measure Orin CAN0_TX has no level change and continues to pull high

thk

hello 305248199,

had you gone through Topic 221272 to setup CAN, and also test with loopback mode?
please share your steps and test results. thanks

yes, steps:

1,modify Kernel DTB
mttcan@c310000 {
status = “okay”;
};
mttcan@c320000 {
status = “okay”;
};
2,modify t186ref/BCT/tegra234-mb1-bct-pinmux-p3701-0000-a04.dtsi
can0_dout_paa0 {
nvidia,pins = “can0_dout_paa0”;
nvidia,function = “can0”;
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
};

                    can0_din_paa1 {
                            nvidia,pins = "can0_din_paa1";
                            nvidia,function = "can0";
                            nvidia,pull = <TEGRA_PIN_PULL_UP>;
                            nvidia,tristate = <TEGRA_PIN_ENABLE>;
                            nvidia,enable-input = <TEGRA_PIN_ENABLE>;
                    };

                    can1_dout_paa2 {
                            nvidia,pins = "can1_dout_paa2";
                            nvidia,function = "can1";
                            nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                            nvidia,tristate = <TEGRA_PIN_DISABLE>;
                            nvidia,enable-input = <TEGRA_PIN_DISABLE>;
                    };

                    can1_din_paa3 {
                            nvidia,pins = "can1_din_paa3";
                            nvidia,function = "can1";
                            nvidia,pull = <TEGRA_PIN_PULL_UP>;
                            nvidia,tristate = <TEGRA_PIN_ENABLE>;
                            nvidia,enable-input = <TEGRA_PIN_ENABLE>;
                    };

3,load kernel module ko
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan

4,configure can-bus
sudo ip link set can0 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
sudo ip link set up can0 mtu 72
sudo ifconfig can0 txqueuelen 1000

sudo ip link set can1 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
sudo ip link set up can1 mtu 72
sudo ifconfig can1 txqueuelen 1000

5, open can-bus interface
sudo ip link set up can0

cangen -L 8 can0 -p 1000 &
cangen -L 8 can1 -p 1000 &

6, oscilloscope to measure Orin CAN0_TX

Use loopback mode, OK

canX_din pin ,I’m configured to pull up. I don’t know if this is the problem

nvidia,pull = <TEGRA_PIN_PULL_UP>;

The problem remains

could you please also refer to Controller Area Network (CAN) for instructions and also debug approaches.

sudo busybox devmem 0x0c303018 w 0x458
sudo busybox devmem 0x0c303010 w 0x400

sudo busybox devmem 0x0c303008 w 0x458
sudo busybox devmem 0x0c303000 w 0x400

Do you want to say that you can use these commands to configure the pin?
The problem remains!

Sometimes configuration will prompt:
[ 7126.416194] mttcan c310000.mttcan can0: Bit0 Error Detected
[ 7126.422000] mttcan c310000.mttcan can0: IR 0x8010000 PSR 0x71d
[ 7126.428041] mttcan c310000.mttcan can0: entered error warning state

$ cansend can1 123#abcdabcd
[ 7780.754333] mttcan c320000.mttcan can1: Bit0 Error Detected
[ 7780.760190] mttcan c320000.mttcan can1: IR 0x8010000 PSR 0x71d
[ 7780.766240] mttcan c320000.mttcan can1: entered error warning state
[ 7780.772701] mttcan c320000.mttcan can1: entered error passive state
[ 7780.779171] mttcan c320000.mttcan can1: entered bus off state
[ 7780.785100] mttcan c320000.mttcan can1: Bit0 Error Detected
[ 7780.790853] mttcan c320000.mttcan can1: IR 0xb800000 PSR 0x7e5

Does Orin’s E59 GPIO06 CAN0_STB pin need to be connected? It’s in the air now

$cat /sys/kernel/debug/bpmp/debug/clk/can1/parent
pll_aon

$cat /sys/kernel/debug/bpmp/debug/clk/can0/pto_counter
199976960

We use CA-IS3050G transceiver

You can try WaveShare SN65HVD230 CAN board transceiver。

https://docs.nvidia.com/jetson/archives/r35.1/DeveloperGuide/text/HR/ControllerAreaNetworkCan.html

Follow the linked document:
按照链接文档操作:

1,
sudo busybox devmem 0x0c303018 w 0x458
sudo busybox devmem 0x0c303010 w 0x400

sudo busybox devmem 0x0c303008 w 0x458
sudo busybox devmem 0x0c303000 w 0x400
2,
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan

3,
sudo sh -c ‘echo 0x600 > /sys/devices/platform/c310000.mttcan/net/can1/tdc_offset’
sudo sh -c ‘echo 0x600 > /sys/devices/platform/c320000.mttcan/net/can2/tdc_offset’

4,
$ sudo ip link set can0 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
$ sudo ip link set can1 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on

5,
candump -x any &

6,
cansend can0 123##1abcdabcd

Oscilloscope has no waveform
示波器没有波形

hello 305248199,

could you please share the pin connections, please also refer to the diagram for correct connection.

can transceiver sch

orin_can_sch

Orin CAN picky transceiver?

我是用了NV推荐的这个收发器,CAN就可以发送数据了。
I am using the transceiver recommended by NV, CAN module can send data.

谢谢!
thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.