How to Persist CAN Bus Configuration on Nvidia Jetson Orin Nano Dev Board

Issue Overview

Users of the Nvidia Jetson Orin Nano Dev Board are experiencing difficulties in persisting the configuration for the Controller Area Network (CAN) bus. The specific symptoms include:

  • Loading Modules: Users report that while the can and can_raw modules load successfully, the mttcan module fails to load when specified in /etc/modules-load.d/can.conf.

  • Pin Configuration: Users are uncertain about how to configure the RX and TX pins for CAN communication.

  • Interface Setup: There is confusion regarding how to bring up the can0 interface automatically at boot, with suggestions pointing to various configuration files that may not be applicable for the L4T (Linux for Tegra) environment.

The issue appears to occur during system boot, impacting users’ ability to utilize CAN functionality effectively. The problem is consistent across multiple users, leading to frustration as they seek reliable solutions.

Relevant specifications include:

  • Operating System: L4T (Linux for Tegra)
  • Kernel Version: 5.10.120-tegra
  • Hardware: Nvidia Jetson Orin Nano Developer Kit

The impact of this issue is significant, as it prevents users from utilizing CAN bus capabilities without manual intervention each time the system boots.

Possible Causes

Several potential causes have been identified for the issues surrounding CAN bus configuration:

  • Module Loading Issues: The mttcan module is blacklisted, preventing it from loading automatically at boot.

  • Configuration Errors: Users may not be aware of the correct files or methods needed to configure both pin settings and network interfaces in L4T.

  • Driver Conflicts: The presence of blacklisted modules can lead to conflicts when attempting to load necessary drivers for CAN functionality.

  • Environmental Factors: Inadequate power supply or thermal conditions could also affect module loading or device operation.

  • User Misconfigurations: Lack of familiarity with Linux networking configurations may lead users to incorrect setups or commands.

Troubleshooting Steps, Solutions & Fixes

To resolve the issues related to persisting CAN bus configuration, follow these comprehensive troubleshooting steps:

  1. Check Blacklist Configuration:

    • Open the blacklist configuration file:
      cat /etc/modprobe.d/denylist-mttcan.conf
      
    • Comment out the line that blacklists mttcan:
      # blacklist mttcan
      
    • This step allows mttcan to load at boot time.
  2. Load Modules Manually:

    • Test loading modules manually using:
      modprobe can
      modprobe can_raw
      modprobe mttcan
      
    • Confirm successful loading by checking with:
      lsmod | grep -E "can|mttcan"
      
  3. Configure Pins Using rc.local:

    • Create or edit /etc/rc.local to include commands for loading modules and setting up pin configurations:
      #!/bin/bash
      
      # Load CAN kernel drivers
      modprobe can
      modprobe can_raw
      modprobe mttcan
      
      # Set up pinmux configurations using busybox devmem
      busybox devmem 0x0c303018 w 0xc458
      busybox devmem 0x0c303010 w 0xc400
      
      # Set CAN bus bitrate and bring up interface
      ip link set can0 type can bitrate 500000
      ip link set can0 up
      
      exit 0
      
    • Ensure this script is executable:
      chmod +x /etc/rc.local
      
  4. Verify Interface Configuration:

    • If using systemd, create a configuration file under /etc/systemd/network/, but confirm whether systemd-networkd is enabled.
    • Alternatively, if using traditional networking methods, ensure proper scripts are placed in /etc/network/if-up.d/.
  5. Test Configuration After Boot:

    • After making these changes, reboot the system and check if mttcan loads automatically and whether the CAN interface comes up as expected.
    • Use the command:
      dmesg | grep can
      
    • Review logs for any errors or confirmations regarding module loading.
  6. Documentation and Resources:

  7. Best Practices:

    • Regularly check for updates on kernel configurations that may affect module loading.
    • Document any changes made for future reference and troubleshooting.

By following these steps, users should be able to persist their CAN bus configuration effectively on the Nvidia Jetson Orin Nano Dev Board. If issues persist, further investigation into kernel settings or community forums may be necessary for advanced troubleshooting.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *