SLCAN - Jetpack 6

Hi everyone,

I am trying to bridge UDP to CAN using slcand on my Jetson AGX Orin Develeoper Kit with Ubuntu 22.04 (JetPack 6). While the UDP link to /dev/ttycan0 works, I encounter the following error when trying to use slcand:

slcand -o -c -F -s8 /dev/ttycan0 vcan0 &

Ioctl TIOCSETD: Invalid Argument

I’ve tried various options, but none have worked. Interestingly, when I set this up on an AGX Xavier with Ubuntu 20.04 (Focal), it works fine without any issues.

Additionally, when I attempt to load the slcan module on my Orin system I get the following error:

xyz-desktop:~/xxx$ sudo modprobe slcan 
modprobe: FATAL: Module slcan not found in directory /lib/modules/5.15.136-tegra

Is it possible to use SLCAN with JetPack 6? Has anyone successfully set up SLCAN on Ubuntu 22.04 for Jetson devices, or are there any known workarounds for this issue?

Thank you in advance for any advice or solutions!

for reference here is my full script

# Start socat to forward UDP packets to the pseudo-terminal device
socat udp4-datagram:192.168.131.2:11412,bind=:11412,range=192.168.131.1/24 pty,link=/dev/ttycan0 &
echo $! > /run/can-udp-bridge.pid

sleep 1

# Start slcand to create the vcan0 interface
slcand -o -c -F -s8 /dev/ttycan0 vcan0 &
echo $! >> /run/can-udp-bridge.pid

sleep 1

# Create the virtual CAN interface if not already created
ip link add dev vcan0 type vcan

# Set txqueuelen for vcan0 and bring it up
ip link set vcan0 txqueuelen 100
ip link set vcan0 up

Best regards,

Hi,
Please check the quick start in developer guide and make sure you follow the steps one by one:
https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/IN/QuickStart.html
If the device still cannot be flashed/booted, please refer to the page to get uart log from the device:
https://elinux.org/Jetson/General_debug
If you are using custom board, you can compare uart log of developer kit and custom board to get more information.

Thanks!

Hello @carolyuu I am not sure how your answer is relevant to my problem? Or is it a automatic answer?

Thanks

Hi batuhan.sakal,

What’s the Jetpack version in your case? 6.0 or 6.1?

Please share the result of the following command on your board.

$ zcat /proc/config.gz | grep CONFIG_CAN_SLCAN

And also the full dmesg for further check.

Hello @KevinFFF,

I use JetPack 6.0:

5.15.136-tegra
nvidia-l4t-core 36.3.0-20240719161631

Here is the result of the command you asked:

-desktop:~$ zcat /proc/config.gz | grep CONFIG_CAN_SLCAN
# CONFIG_CAN_SLCAN is not set

As far as I understand, the SLCAN driver is not installed in my kernel. I don’t see it under:

-desktop:/lib/modules/5.15.136-tegra/kernel/drivers/net/can$ ls
dev/  flexcan.ko  rcar/  vcan.ko

But I do see the driver in the Driver Package (BSP) Sources.
https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v3.0/sources/public_sources.tbz2

Do I need to customize my kernel according to the instructions in the NVIDIA Kernel Customization Guide?

Thanks for your help!

Hi @KevinFFF,

I successfully downloaded the driver files and installed the SLCAN module. I built the slcan.ko file and copied it to /drivers/net/can. Now, the SLCAN starts without any issues. I’ll be testing the full setup today as well.

yes, it seems SLCAN is not enabled in kernel of JP6 by default.

Please enable it in kernel image or build it as kernel module to load it manually to verify.

Hello Kevin,

I downloaded the Driver Package (BSP) Sources and after enabling the SLCAN in config, I installed the modules and retrieved the slcan.ko driver, now it works without problem.

Thank you for help!

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