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
-
Incorrect device tree configuration: The ADC node might not be properly defined or placed in the device tree structure.
-
Driver build issues: The MCP3911 driver may not be correctly built into the kernel image or as a loadable module.
-
Probing failure: The driver might fail to probe the hardware due to mismatched configurations or hardware issues.
-
SPI bus configuration: Incorrect SPI bus setup in the device tree or driver could prevent communication with the ADC.
-
Incompatibility between Jetpack 6 and the MCP3911 driver: There might be unforeseen issues with the latest Jetpack version and the driver.
-
UEFI binary interference: The default DTB loading mechanism in Jetpack 6 might be interfering with custom device tree modifications.
Troubleshooting Steps, Solutions & Fixes
-
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 orCONFIG_MCP3911=m
for module. -
Modify device tree:
Instead of creating a separateadc@0
node, try porting the configuration into the existingspi@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>; }; }; }
-
Force DTB loading:
Edit/boot/extlinux/extlinux.conf
and add the following line to theprimary
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.
-
Add debug logs:
Modify themcp3911.c
driver source to include additional debug logs in themcp3911_probe()
function. This will help identify where the probing process fails. -
Verify SPI communication:
Use a logic analyzer or oscilloscope to confirm SPI activity during boot and driver initialization. -
Check interrupt configuration:
Ensure the interrupt pin is correctly configured in both hardware and the device tree. -
Isolate hardware issues:
Test the ADC with a simple spidev-based program to verify hardware functionality. -
Review Jetpack 6 compatibility:
Check NVIDIA developer forums and documentation for any known issues with SPI or IIO drivers in Jetpack 6. -
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.
-
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.