Jetson Orin Nano MCP3911 Driver Not Loading

Issue Overview

Users are experiencing difficulties with the MCP3911 driver on a Jetson Orin Nano with a custom carrier board running Jetpack 6. The main symptoms include:

  • The MCP3911 driver is not being loaded or probed
  • No IIO (Industrial I/O) devices are being created
  • No mentions of ADC, MCP391x, or related terms in dmesg output
  • No SPI bus activity, even during boot
  • The driver doesn’t attempt to communicate with the ADC

The issue occurs after adding the MCP3911 driver to the kernel config and modifying the device tree to include the MCP3914 (which is compatible with the MCP3911 driver). The problem persists despite successful modification of the device tree file.

Possible Causes

  1. Incorrect device tree configuration: The ADC node might not be properly defined or placed in the device tree structure.

  2. Driver build issues: The MCP3911 driver may not be correctly built into the kernel image or as a loadable module.

  3. Probing failure: The driver might fail to probe the hardware due to mismatched configurations or hardware issues.

  4. SPI bus configuration: Incorrect SPI bus setup in the device tree or driver could prevent communication with the ADC.

  5. Incompatibility between Jetpack 6 and the MCP3911 driver: There might be unforeseen issues with the latest Jetpack version and the driver.

  6. UEFI binary interference: The default DTB loading mechanism in Jetpack 6 might be interfering with custom device tree modifications.

Troubleshooting Steps, Solutions & Fixes

  1. Verify driver build:
    Check if the driver is built into the kernel or as a module:

    $ zcat /proc/config.gz | grep CONFIG_MCP3911
    

    Ensure the output shows CONFIG_MCP3911=y for built-in or CONFIG_MCP3911=m for module.

  2. Modify device tree:
    Instead of creating a separate adc@0 node, try porting the configuration into the existing spi@0 node:

    spi@3210000 {
      status = "okay";
      spi@0 {
        compatible = "microchip,mcp3911";
        reg = <0>;
        spi-max-frequency = <20000000>;
        interrupt-parent = <&gpio>;
        interrupts = <6 2>;
        microchip,device-addr = <0>;
        controller-data {
          nvidia,enable-hw-based-cs;
          nvidia,rx-clk-tap-delay = <0x10>;
          nvidia,tx-clk-tap-delay = <0x0>;
        };
      };
    }
    
  3. Force DTB loading:
    Edit /boot/extlinux/extlinux.conf and add the following line to the primary section:

    FDT /boot/dtb/kernel_tegra234-p3768-0000+p3767-0004-nv.dtb
    

    This ensures the modified DTB is loaded instead of the one in the UEFI binary.

  4. Add debug logs:
    Modify the mcp3911.c driver source to include additional debug logs in the mcp3911_probe() function. This will help identify where the probing process fails.

  5. Verify SPI communication:
    Use a logic analyzer or oscilloscope to confirm SPI activity during boot and driver initialization.

  6. Check interrupt configuration:
    Ensure the interrupt pin is correctly configured in both hardware and the device tree.

  7. Isolate hardware issues:
    Test the ADC with a simple spidev-based program to verify hardware functionality.

  8. Review Jetpack 6 compatibility:
    Check NVIDIA developer forums and documentation for any known issues with SPI or IIO drivers in Jetpack 6.

  9. Kernel module loading:
    If the driver is built as a module, try manually loading it:

    $ sudo modprobe mcp3911
    

    Check dmesg output for any error messages.

  10. Consult MCP3914 documentation:
    Review the datasheet and application notes for the MCP3914 to ensure all required configurations are properly set in the device tree and driver.

If these steps do not resolve the issue, consider reaching out to NVIDIA support or the Jetson developer community for further assistance. Additionally, you may need to investigate potential hardware-specific issues on your custom carrier board that could be affecting the SPI communication or interrupt handling.

Similar Posts

Leave a Reply

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