DTS File for ADV7282A-M

Hi,

I am trying to interface my Jetson Orin Nano Dev Board with a custom board that has 2 ADV7282A-M CSI digitizers. My application does not require power or a reset pin, just a 1 lane CSI interface and I2C (both digitizers are on the same bus with different addresses).

I have verified that the ADV7282M board works with a Raspberry Pi. I am now developing a DTS file for Jetson Orin Nano.

adv7282a-m.dts.txt (7.0 KB)

I have based my overlay on this DTS file, for another dual camera setup: vc_mipi_nvidia/src/devicetree/NV_DevKit_OrinNano/tegra234-p3767-camera-p3768-vc_mipi-dual.dts at master · VC-MIPI-modules/vc_mipi_nvidia · GitHub

I watched this: V4L2 Sensor Driver Development (Advanced)
but it did not clear up how to deal with setting up the i2c bus and seemed outdated but did a good job explaining how the endpoints must connect.

My version does not load on boot. I believe that in the cam_i2cmux section there is supposed to be an i2c-parent section and other dts files I have seen use &cam_i2c. I found that this is defined as “bus@0/i2c@3180000” in the symbols section of the base dtb file in /boot/dtb but I get an error “Reference to non-existent node or label “cam_i2c”. I’m currently running dtc -O dtb -o tegra234-p3767-camera-p3768-adv7282a-m.dto -@ adv7282a-m.dtsto compile to dtbo. I then copy the dtbo into /boot.

I have been using sudo /opt/nvidia/jetson-io/jetson-io.py and I see my overlay show up and go through the process to reconfigure the pins and reboot. Then on boot I get an “Unable to boot via extlinux” error.

What could be causing the “unable to boot” error? This question may be way too broad so the next one may be more relevant.

How can I reference the cam_i2c bus? In other files it seems they have include statements but I get syntax errors when I try to compile if there are includes.

You can reference to imx219/imx477 for using cam_i2cmux.

Where are those files located?

Hello @mgamota2,

You can find the imx219 and imx477 dtbs in your jetpack sources, the location might change depending on which JP you are using, but for JP 6.2.1 you can find it here:

./Linux_for_Tegra/source/hardware/nvidia/t23x/nv-public/overlay/tegra234-camera-rbpcv2-imx219.dtsi

You can also find it here, which is the repo that meta-tegra uses. Just make sure to choose the branch according to the version of l4t you are using in case there are any changes.

best regards,
Andrew
Embedded Software Engineer at ProventusNova

Is it likely that I do not see this because I installed via microSD? Should I be installing using SDK Manager?

You need download the source code for it.

Hello @mgamota2,

Please follow the link ShaneCCC provided, is super helpful.

But, to give you a super quick summary of what the link mentions:

  1. Yes, download SDK manager.
  2. Use it to download the JP you are working with as if you were going to flash (no need to flash the board).
  3. SDK manager will create directory in ~/nvidia, where you can run the following:
cd <install-path>/Linux_for_Tegra/source
./source_sync.sh -k -t <release-tag>

That will get you the sources.

Please let me know if you need further support, this might be a bit complex if it was your first time doing it.

best regards,
Andrew
Embedded Software Engineer at ProventusNova

This link describes doing all of the development on a host machine and then doing cross compilation and flashing the Jetson? Is this method recommended over something like this where I do all of the development on the Jetson itself? Build Jetson Orin Kernel and Modules - JetsonHacks ?

Regarding the overlay, is the correct way to do that to use the dtc command to compile a .dts into a .dtbo? Is using jetson-io.py to apply the .dtbo the recommended method?

Building the kernel is only required for enabling the driver, correct?

My question about the “includes” in my .dts file still stands, how can I use includes in the dts file, it gives me a syntax error. Do I need to run the dtc in a particular folder?

Hello @mgamota2,

Let me answer your questions 1 by 1:

  1. Is it recommended to compile on a host machine rather than directly on the Jetson?

Yes, it is recommended that you do kernel and dtb development on a linux host machine, then you flash the board or move the compiled elements into it.

When it comes to user-space applications you can work natively on the Jetson since is a different set of requirements and libraries.

  1. Regarding the overlay, is the correct way to do that to use the dtc command to compile a .dts into a .dtbo? Is using jetson-io.py to apply the .dtbo the recommended method?

Yes, that is one way of doing it. You can also compile the overlays along with the DTBs if you were compiling on a host machine.

  1. Building the kernel is only required for enabling the driver, correct?

Yes. That is right. Unless you have further kernel modifications that you need for your HW setup to work properly.

  1. My question about the “includes” in my .dts file still stands, how can I use includes in the dts file, it gives me a syntax error. Do I need to run the dtc in a particular folder?

This is how includes work:

#include "tegra234-p3768-0000.dtsi"

You need to consider that the path for the file to include needs to be given from taking as root the directory of the file you are including the file into.

Please let me know if you haver further questions.

Also, just to put the option on the table, we could help you with your camera driver so you can get back to working on the actual application as fast as possible.

best regards,
Andrew
Embedded Software Engineer at ProventusNova

Hi Andrew,

Thank you very much.
My custom board has 2 ADV7282A-M video decoders. When I run v4l2-ctl –list-devices:


v4l2-ctl --list-devices

NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):

	/dev/media0

vi-output, adv7180 10-0020 (platform:tegra-capture-vi:1):

	/dev/video1

vi-output, adv7180 9-0021 (platform:tegra-capture-vi:2):

	/dev/video0

When I run media-ctl /dev/media0 -p:

media-ctl /dev/media0 -p
Media controller API version 5.15.148
Media device information

driver          tegra-camrtc-ca
model           NVIDIA Tegra Video Input Device
serial
bus info
hw revision     0x3
driver version  5.15.148

Device topology

entity 1: 13e00000.host1x:nvcsi@15a00000- (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
 ← “adv7180 10-0020”:0 [ENABLED]
pad1: Source
 → “vi-output, adv7180 10-0020”:0 [ENABLED]

entity 4: 13e00000.host1x:nvcsi@15a00000- (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
pad0: Sink
 ← “adv7180 9-0021”:0 [ENABLED]
pad1: Source
 → “vi-output, adv7180 9-0021”:0 [ENABLED]

entity 7: adv7180 9-0021 (1 pad, 1 link)
type V4L2 subdev subtype Decoder flags 0
device node name /dev/v4l-subdev2
pad0: Source
[fmt:UYVY8_2X8/736x480@1001/30000 field:none colorspace:smpte170m]
 → “13e00000.host1x:nvcsi@15a00000-”:0 [ENABLED]

entity 9: vi-output, adv7180 9-0021 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
 ← “13e00000.host1x:nvcsi@15a00000-”:1 [ENABLED]

entity 23: adv7180 10-0020 (1 pad, 1 link)
type V4L2 subdev subtype Decoder flags 0
device node name /dev/v4l-subdev3
pad0: Source
[fmt:UYVY8_2X8/736x480@1001/30000 field:none colorspace:smpte170m]
 → “13e00000.host1x:nvcsi@15a00000-”:0 [ENABLED]

entity 25: vi-output, adv7180 10-0020 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video1
pad0: Sink
 ← “13e00000.host1x:nvcsi@15a00000-”:1 [ENABLED]

The ADV7282A-M that is connected to CAM1 available at /dev/video0 and the ADV7282A-M that is connected to CAM0 is /dev/video1.

I am now able to get live video from /dev/video0 of my sources using gst-launch-1.0 -evvv v4l2src device=/dev/video0 ! ‘video/x-raw, framerate=60/1, format=UYVY’ !videoconvert ! autovideosink –eos-on-shutdown. When I run the same command with /dev/video0, I get a green screen. I think this could be due to the lane polarity fix not happening in my overlay? (attached)

For both video0 and video1 I get some errors here:

v4l2-ctl -d /dev/video0 --stream-mmap --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq: 0 bytesused: 706560 ts: 462.893376 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 706560 ts: 462.910059 delta: 16.683 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 706560 ts: 462.926741 delta: 16.682 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 706560 ts: 462.943423 delta: 16.682 ms (error, ts-monotonic, ts-src-eof)

v4l2-ctl -d /dev/video0 --stream-mmap --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq: 0 bytesused: 706560 ts: 462.893376 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 706560 ts: 462.910059 delta: 16.683 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 706560 ts: 462.926741 delta: 16.682 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 706560 ts: 462.943423 delta: 16.682 ms (error, ts-monotonic, ts-src-eof)

My driver is also attached here, but note that when I run the gst command for video1 or video0, the corresponding ADV7282A-M starts to output data (confirmed by oscilloscope), but the CLKP/N lines traces look like nothing is happening.

My questions are as follows:

  • Is the green screen issue indicative of the data lane swapping issue ( I have seen this in other forum posts related to CAM0 vs CAM1 device trees)? If so, do I just need to add a mode0 to each ADV7282A-M in the dts file? I tried briefly but it caused a crash on boot.

  • Based on the fact that I am able to see video using gst-launch-1.0, does this imply that the clock signals are actually working and that it is a measurement/scope limitation issue? Does gst-launch have some built in clock reconstruction? Is there another video viewing method I should use to test this thoery? I think the v4l2-ctl –stream-mmap result might be important here but I’m not sure.

Basically I am wondering if I need to fix the device tree, figure out if the driver is incorrectly configuring the clock, or both.

Thank you,
Michael

adv7180.txt (49.1 KB)

dual_overlay.txt (9.2 KB)

Please get the trace log to check.

sudo modprobe rtcpu_debug

echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 3 > /sys/kernel/debug/camrtc/log-level
echo 1 > /sys/kernel/debug/tracing/events/camera_common/enable
echo > /sys/kernel/debug/tracing/trace

v4l2-ctl --stream-mmap -c bypass_mode=0

cat /sys/kernel/debug/tracing/trace

Thank you. Recall video1 only outputs a green screen. video0 sometimes outputs good video but other times glitches where subsequent frames do not line up, and it looks like it is trying to fit 2 frames in the gst window.

trace_log_video1_20251126_1144.txt (1.5 MB)

trace_log_video0_20251126_1143.txt (1.5 MB)

Looks like pixel short line in the trace log.

  1. Boost the clocks to check if still see the CHANSEL_FAULT in the trace log.
  2. If above still see the CHANSEL_FAULT you may confirm the output size and embedded data size.
sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate
PIXEL_SHORT_LINE

Hi,

This did not fix the green screen issue. I have verified that both devices (the ADV7282A-M at 0x20 and the ADV7282A-M at 0x21) produce video output when plugged into CAM1.

Based on this, I believe that the issue is purely related to the lane swapping issue on CAM0 compared to CAM1 on the Jetson Orin Nano. It is referenced here: Moving CSI-2 Camera from CAM0 to CAM1 in Jetson Orin Nano Device Tree

It seems that I need to add a lane_polarity line to a mode0 { } section. The problem is that when I add a mode0 { } section to my current overlay (attached), the Jetson will not boot.

How should I do the polarity swap?

adv7180.txt (49.1 KB)

mode-single.txt (5.5 KB)

This property won’t cause the system boot failed. It could be something broken the dtb cause system can’t boot.

What is the correct place to put the lane_polarity line? My driver does not support modes.

You can reference to imx219/imx477 for the location.

Thanks

Hi

IMX219/IMX477 both put lane_polarity in modeX sections, my driver does not have modeX support. I am now trying to use the method described here: Orin Nano and tc358743 capture issue - #75 by akvadak66

Do I need to rebuild the entire Image or can I make this change just by adding the .ko file in a similar fashion to enabling the adv7180.ko driver?

You can connect to another connector that don’t need add lane_polarity to confirm the root cause first.