Controlling MAX7320 Virtual GPIO on Jetson Orin Nano with Jetpack SDK 6.0
Issue Overview
Users are experiencing difficulties controlling the MAX7320 I2C slave device, specifically its virtual GPIO functionality, on the Jetson Orin Nano Developer Kit running Jetpack SDK 6.0. The problem manifests as an inability to enable buck regulator supply voltage using the virtual GPIO created by the MAX7320 IC. This issue appears to be specific to Jetpack SDK 6.0, as the setup previously worked fine with Jetpack SDK 5.1.1 and Jetson Linux 35.3.1.
The MAX7320 is connected to the Jetson Orin Nano’s expansion header J40, using pins 3 (I2C1_SDA) and 5 (I2C1_SCL). While the driver is probed and virtual GPIOs are exposed, attempts to control the output supply using gpioset and gpioget commands do not result in the expected voltage output.
Possible Causes
-
Software Compatibility: The transition from Jetpack SDK 5.1.1 to 6.0 may have introduced compatibility issues with the MAX7320 driver or GPIO subsystem.
-
Driver Issues: Although the source code for the MAX7320 driver (drivers/gpio/gpio-max732x.c) is reportedly the same in both Linux kernel versions 5.10 and 5.15, there might be subtle differences in how the driver interacts with the new SDK.
-
Configuration Errors: The device tree configuration for the MAX7320 might need adjustments for Jetpack SDK 6.0.
-
Power Supply Issues: The problem could be related to power supply configuration or initialization in the new SDK version.
-
Hardware Incompatibility: There might be unforeseen hardware incompatibilities between the Jetson Orin Nano and the custom board when using Jetpack SDK 6.0.
Troubleshooting Steps, Solutions & Fixes
-
Verify Jetpack SDK Version:
Confirm that you are using the correct version of Jetpack SDK 6.0. The user mentioned using the production release with Jetson Linux 36.3. -
Check Device Tree Configuration:
Ensure that the device tree node for MAX7320 is correctly configured. The provided configuration appears as follows:hdr40_i2c1: i2c@c250000 { status = "okay"; gpio_exp_1: gpio@58 { compatible = "maxim,max7320"; status = "okay"; reg = <0x58>; gpio-controller; #gpio-cells = <2>; gpio-line-names = "O0", "O1", "O2", "O3","O4", "O5", "O6", "O7"; }; };
Verify that this configuration is correctly loaded and applied.
-
Analyze Boot Logs:
Examine the full dmesg output for any errors or warnings related to the MAX7320 module loading during boot-up. This can provide valuable insights into potential issues. -
Power Supply Configuration:
The user reported success after configuring an additional GPIO to enable power to the regulator. Ensure that the input supply voltage is correctly provided to the buck regulator. This step appears to be crucial for proper functionality. -
Use libgpiod Commands:
After addressing the power supply issue, the user was able to control the MAX7320 using libgpiod commands. Try using these commands instead of the gpioset and gpioget commands initially used:gpiomon --falling-edge gpiochip2 3 4 gpioset gpiochip2 3=1 4=1
-
I2C Communication Verification:
Use i2c-tools to verify communication with the MAX7320:sudo i2cdetect -y -r 1 sudo i2cdump -y 1 0x58
This can help identify if the issue is with I2C communication or GPIO control.
-
Kernel Module Inspection:
Check if the MAX7320 kernel module is correctly loaded:lsmod | grep max7320
If not present, try manually loading it:
sudo modprobe gpio-max732x
-
GPIO Sysfs Interface:
As an alternative to libgpiod, try using the sysfs interface to control GPIOs:echo 498 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio498/direction echo 1 > /sys/class/gpio/gpio498/value
Replace 498 with the appropriate GPIO number for your setup.
-
Driver Debugging:
If the issue persists, consider enabling debug output for the MAX7320 driver. This may require recompiling the kernel module with additional debug flags. -
Jetpack SDK Rollback:
If all else fails, consider temporarily rolling back to Jetpack SDK 5.1.1 to confirm that the issue is indeed related to the SDK upgrade. This can help isolate whether the problem is software or hardware-related.