Hello,
I am trying to interface a Jetson Orin NX (8GB) to the Analog Devices ADV7282A-M
analog video decoder board. I’m using Jetson Linux v36.3. The driver for the ADV
board is included in the Jetson kernel source tree, but is not built by default.
After modifying the kernel config to build the adv7180 module, modifying the
device tree, building the kernel and dtbs and flashing the board, I am unable
to load the adv7180 module. It is unable to find the module, even though it
clearly exists:
$ sudo insmod adv7180.ko
insmod: ERROR: could not load module adv7180.ko: No such file or directory
$ sudo modprobe adv7180.ko
modprobe: FATAL: Module adv7180.ko not found in directory /lib/modules/5.15.136-tegra
$ sudo find /lib/modules -name adv7180.ko
/lib/modules/5.15.136-tegra/kernel/drivers/media/i2c/adv7180.ko
What am I missing? Does this error actually indicate an issue with the device tree?
Below is more detail on the exact procedure I’ve followed, with links to the
relevant Developer Guide sections:
Download and unpack the BSP and sample root file system per Quick Start.
Modify kernel config to build the adv7180 module. This is a bit tedious
with make menuconfig, so I just edited the makefile:
vim Linux_for_Tegra/source/kernel/kernel-jammy-src/drivers/media/i2c/Makefile
#obj-$(CONFIG_VIDEO_ADV7180) += adv7180.o
obj-m += adv7180.o
Modify the device tree to register the new ADV device.
I’m using the ADV7282A-M device tree file shared from another forum post here, specifically tegra186-camera-adv7281am-a00.dtsi.
Included the new device file from the top-level file Linux_for_Tegra/source/hardware/nvidia/t23x/nv-public/nv-platform/tegra234-p3768-0000+p3767-0001-nv.dts.
I initially tried to include the new device file from the one specified here, but it did not work. The new contents are not included in the compiled output.
I updated the kernel config following this process, rebuilt the kernel and booted into it. The result is that the running kernel config now shows the module is configured (it did not before). However, I still cannot load it, with the same error as before.
$ zcat /proc/config.gz | grep CONFIG_VIDEO_ADV7180
CONFIG_VIDEO_ADV7180=m
$ sudo insmod adv7180.ko
insmod: ERROR: could not load module adv7180.ko: No such file or directory
The module is there. Copying it again does not help.
$ ls -l /lib/modules/5.15.136-tegra/kernel/drivers/media/i2c/adv7180.ko
-rw-r--r-- 1 root root 150369 Jul 21 2024 /lib/modules/5.15.136-tegra/kernel/drivers/media/i2c/adv7180.ko
$ sudo insmod adv7180.ko
insmod: ERROR: could not load module adv7180.ko: No such file or directory
For some reason sudo insmod adv7180.ko worked to load the module before I started modifying the device tree.
I’m still not getting a /dev/video0 device after loading the adv7180 module. Presumably there is an issue with the device tree. Should I open a separate ticket for that?
Check the probe() function to check the video register
Please elaborate on how I would go about doing this. Are you suggesting to modify the module source code, adding print statements inside the adv7180_probe function?
I’m currently assuming that the driver code is fine and the issue is with my device tree. I’ve tried several .dtsi modifications, and in each case I don’t see anything with dmesg upon loading the module, nor do I get a /dev/video0 device file.
No errors or other messages with dmesg upon loading the module. Attached is the .dtsi I am using. I could really use some advice on how the .dtsi file should be structured. I’m trying to piece it together from the dev guide info and ADV .dtsi files in related forum posts (here and here), but there are definitely some gaps in my understanding. My goal is to use the Direct V4L2 Interface to get camera data into a GStreamer application with v4l2src.
The device tree is getting populated per the .dtsi file:
$ ls /proc/device-tree/i2c@3180000/adv7282am@42/
compatible devnode name ports reg sensor_model
I have added print statements to the driver adv7180_probe function at entry and every early exit point. None of them appear in the dmesg output after loading the module. The print statements are info level (e.g. pr_info). The current console log level is 8 (see below), so I have no idea why they are not appearing:
Below is some additional info that may be helpful in getting to the bottom of this.
There were some warnings compiling the device tree (shown below). Please let me know if any of these warnings should be addressed via changes to the .dtsi:
$ make dtbs |& grep adv7282
/home/troyb/Downloads/nvidia/custom/Linux_for_Tegra/source/hardware/nvidia/t23x/nv-public/overlay/tegra234-p3768-camera-adv7282am.dtsi:54.4-17: Warning (reg_format): /i2c@3180000/adv7282am@42:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
/home/troyb/Downloads/nvidia/custom/Linux_for_Tegra/source/hardware/nvidia/t23x/nv-public/overlay/tegra234-p3768-camera-adv7282am.dtsi:50.14-71.4: Warning (i2c_bus_bridge): /i2c@3180000: incorrect #address-cells for I2C bus
/home/troyb/Downloads/nvidia/custom/Linux_for_Tegra/source/hardware/nvidia/t23x/nv-public/overlay/tegra234-p3768-camera-adv7282am.dtsi:50.14-71.4: Warning (i2c_bus_bridge): /i2c@3180000: incorrect #size-cells for I2C bus
/home/troyb/Downloads/nvidia/custom/Linux_for_Tegra/source/hardware/nvidia/t23x/nv-public/overlay/tegra234-p3768-camera-adv7282am.dtsi:51.16-70.5: Warning (avoid_default_addr_size): /i2c@3180000/adv7282am@42: Relying on default #address-cells value
/home/troyb/Downloads/nvidia/custom/Linux_for_Tegra/source/hardware/nvidia/t23x/nv-public/overlay/tegra234-p3768-camera-adv7282am.dtsi:51.16-70.5: Warning (avoid_default_addr_size): /i2c@3180000/adv7282am@42: Relying on default #size-cells value
Since there is nothing logged by the kernel when I load the ADV driver, I’m taking a step back and trying to verify whether the ADV board is even communicating over I2C using the linux i2c-tools package. I have verified the physical connections (I2C and CSI, specifically) are correct, to the extent that I can anyway. As mentioned above, the ADV board is connected to the Jetson’s CAM0 (J20) connector. Which I2C bus from the i2cdetect output below does this correspond to? I’m current specifying bus 2 (i2c-2) in the .dtsi. However, on page 19 of the dev kit carrier board spec, it says “The module CAM_I2C pins connect to an I2C mux.” Does this mean I should be using the i2c-10 bus instead?
@ShaneCCCThis old forum post potentially explains why the print statements in the module probe function don’t appear in dmesg. Am I understanding correctly that the module probe function may not be called if there is an issue with the device tree?