Slcan module not working with my can-usb device even after recompiling kernel

Hi,
I got Nvidia Jetson Orin Nano dev kit and was trying to get slcan module working. I customised kernel and added slcan module to defconfig (CONFIG_CAN_SLCAN=m, CONFIG_TTY=y ), built the kernel and flashed it. Jetson booting normally and everything’s working well.

When I type on jetson:
$ zcat /proc/config.gz | grep -E "CONFIG_CAN_SLCAN|CONFIG_TTY"
I get:

CONFIG_CAN_SLCAN=m
CONFIG_TTY=y

#CONFIG_TTY_PRINTK is not set

I can load slcan and can properly:
$ sudo apt-get install can-utils
$ sudo modprobe can
$ sudo modprobe can_raw
$ sudo modprobe slcan

I tried creating a virtual can and tried with can dump and all and it’s working.

I connected my can-usb canable module to jetson and through dmesg, I saw it connecting but recognised as simple usb module.

Anyway, I got it as /dev/ttyACM0. I tried doing:
$sudo slcand -o -c -f -s6 /dev/ttyACM0 slcan1 # existing can0 seem to be part of mttcan, so I selected slcan1 as name

It executed. Then I did:

$ sudo ip link set can1 type can bitrate 1000000 loopback off

It gave error:
RTNETLINK answers: Operation not supported

Same commands are working normally on my ubuntu PC when connecting same usb-can device (and did sudo ifconfig slcan1 up at last) and able to connect and do all with the module on PC.

Earlier I got more weird messages on jetson like when enabling slcan on my tty device like Input/Output error, baud rate not correct(0), etc.

I need help sorting it all out.

My l4t version: 36.4.4
Jetson Orin Nano Dev kit

Used this page to install all requirements: Kernel Customization — NVIDIA Jetson Linux Developer Guide
and followed generally flashing for sd-card inserted in jetson: sudo ./flash.sh jetson-orin-nano-devkit mmcblk0p1

Let me know if need any other details

Thanks

*** Please note that this reply is generated by LLM automatically ***

I’d be happy to help you with your issue.

First, let’s break down the problem:

  • You have a Jetson Orin Nano module and you’re trying to get the slcan module working.
  • You’ve built the kernel with the necessary configurations (CONFIG_CAN_SL_CAN and CONFIG_TTY) and flashed it to the Jetson module.
  • The Jetson module boots normally, and you can load the slcan module and create a virtual CAN interface.
  • However, when you connect your CANUSB CANable module to the Jetson module, you’re having issues getting it to work.

Now, let’s compare your setup with the documentation and other relevant information:

  • The Jetson Orin Nano module uses a different kernel configuration and flashing process compared to other Jetson modules.
  • The l4t_initrd_flash.sh script is used to flash the kernel and root file system to the Jetson module.
  • The --storage option is not supported on the Jetson Orin Nano module, so you need to use the --external-device option to specify the external storage device (in this case, the SD card).
  • The flash.sh script is used to flash the kernel and root file system to the SD card.

Based on the documentation, it seems that you’ve followed the correct steps to build and flash the kernel. However, there might be some issues with the CANUSB CANable module or the way you’re configuring it.

Here are a few suggestions to help you troubleshoot the issue:

  1. Check the kernel logs: Run the command dmesg to check the kernel logs and see if there are any error messages related to the CANUSB CANable module.
  2. Verify the module configuration: Make sure that the CANUSB CANable module is properly configured and recognized by the kernel. You can check the module configuration using the command lsmod.
  3. Check the device file: Verify that the device file /dev/ttyACM0 is created and accessible. You can check the device file using the command ls -l /dev/ttyACM0.
  4. Try a different USB port: Try connecting the CANUSB CANable module to a different USB port on the Jetson module to rule out any issues with the USB port.
  5. Compare with PC setup: Since you mentioned that the same setup works on your PC, try to compare the kernel configurations and module configurations between the two systems.

If none of these suggestions help, please provide more details about your setup, including the kernel version, module configurations, and any error messages you’re seeing. I’ll do my best to help you troubleshoot the issue.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Thanks for your reply @carolyuu !

  1. No error message related to CANUSB CANable module

  2. Not sure, but seems to be fine, as it works well on my ubuntu PC.

  3. It’s correct

  4. Same behaviour on other ports as well (just to mention I have type-c canable module, so connection on type-C on jettison Orin Nano dev kit)

  5. I tried as much as I can do but cannot point out exact difference.

If you want specific logs or details, let me know.

My setup is using this module in slcan mode: KOOKYE MKS CANABLE 2.0 USB C to CAN Adapter Analyzer CANFD SLCAN SocketCAN CANdleLight Klipper Support for XP/Win7/Win8 : Amazon.fr: Computers

Kernel version: 5.15.148-rt-tegra

Thanks

There is no update from you for a period, assuming this is not an issue anymore.
Hence, we are closing this topic. If need further support, please open a new one.
Thanks
~1105

Hi snktshrma,

Are you using the rt-kernel in your case?
If so, would it work if your use the default kernel with related kernel config enabled?

Could you also share the full dmesg and the result of lsusb for further check?