I am trying to use jetson AGX orin (JetPack 5.1.1. Ubuntu 20.04.6 LTS) can pins (with WaveShare SN65HVD230 CAN transceiver). when i first run it it worked fine. but after that only rx is working and i cant send more commands:
ip -details -statistics link show can0
9: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can state ERROR-PASSIVE (berr-counter tx 176 rx 0) restart-ms 0
bitrate 1000000 sample-point 0.740
tq 20 prop-seg 18 phase-seg1 18 phase-seg2 13 sjw 1
mttcan: tseg1 2…255 tseg2 0…127 sjw 1…127 brp 1…511 brp-inc 1
mttcan: dtseg1 1…31 dtseg2 0…15 dsjw 1…15 dbrp 1…15 dbrp-inc 1
clock 50000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 2 2 1 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
3270480 408816 0 0 0 0
TX: bytes packets errors dropped carrier collsns
14044 1774 0 2 0 0
when restarting mttcan:
sudo rmmod mttcan
sudo modprobe mttcan
it only works for 1 second and then fails again.
I tested:
cansend can0 123#1122334455667788
write: No buffer space available
I tested: sudo busybox devmem 0x0c303018 w 0x454
it also works for 1 sec then fails
Hello,
Welcome to the NVIDIA Developer forums! Your topic will be best served in the Jetson category.
Discussions relating to the Jetson DevKits and other Embedded computing devices
I will move this post over for visibility.
Cheers,
Tom
Hi a.obeidat4,
Are you using the devkit or custom board for AGX Orin?
Please share the block diagram of your connection for CAN interface.
and also the full dmesg for further check.
I am using the devkit.
This is the full connection:
[ 5167.047286] net can0: mttcan device registered (regs=00000000e22ed91d, irq=14)
[ 5167.049182] Message RAM Configuration
| base addr |0x0c322000|
| sidfc_flssa |0x00000000|
| xidfc_flesa |0x00000040|
| rxf0c_f0sa |0x000000c0|
| rxf1c_f1sa |0x000009c0|
| rxbc_rbsa |0x000009c0|
| txefc_efsa |0x000009c0|
| txbc_tbsa |0x00000a40|
| tmc_tmsa |0x00000ec0|
| mram size |0x00001000|
[ 5167.050511] Release 3.2.3 from 09.06.2018
[ 5167.050912] net can1: mttcan device registered (regs=0000000001a31c84, irq=15)
[ 5170.492699] mttcan c310000.mttcan can0: Bitrate set
[ 5170.493466] mttcan_controller_config: ctrlmode 0
[ 5170.493479] mttcan c310000.mttcan can0: Bitrate set
[ 5170.493804] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 5172.105846] mttcan c310000.mttcan can0: entered error warning state
[ 5172.112538] mttcan c310000.mttcan can0: entered error passive state
[ 5172.225432] mttcan c310000.mttcan can0: entered bus off state
Thanks for sharing how you setup and the connection.
It seems you enter into bus-off state, which may be caused from the wrong connection like the CAN-H/CAN-L shorted.
Please apply the following change and check if it could help.
diff --git a/drivers/net/can/mttcan/native/m_ttcan_linux.c b/drivers/net/can/mttcan/native/m_ttcan_linux.c
index 5ae1dd576..18e185a1d 100644
--- a/drivers/net/can/mttcan/native/m_ttcan_linux.c
+++ b/drivers/net/can/mttcan/native/m_ttcan_linux.c
@@ -489,7 +489,8 @@ static int mttcan_state_change(struct net_device *dev,
*/
ttcan_set_intrpts(priv->ttcan, 0);
priv->can.can_stats.bus_off++;
-
+ priv->ttcan->tx_object = 0;
+ netif_stop_queue(dev);
netif_carrier_off(dev);
if (priv->can.restart_ms)
@@ -1098,6 +1099,7 @@ restart:
priv->can.can_stats.restarts++;
mttcan_start(dev);
+ netif_start_queue(dev);
netif_carrier_on(dev);
}
hello kevin, thanks for the reply.
I am new to linux, and i cant find the file i need to edit, could you please elaborate?
thanks
Please refer to Kernel Customization — Jetson Linux Developer Guide documentation (nvidia.com) to sync the kernel source and modify the m_ttcan_linux.c (it is mttcan driver for CAN interface).
After you apply the above patch, please update the kernel image to apply the change.
I’m trying to sync the kernel with git because it is recommended and because manually downloading and extracting looks harder, however I cant locate (./source_sync.sh) file and it is not clear in the documentation where to find it.
Can you help locate it please?
It should be included in BSP package (Linux_for_Tegra/
)
system
Closed
August 28, 2024, 7:08am
13
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.