Skip to content

Commit

Permalink
PR #231 from dmipx: JP6 - Dual camera configuration support
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az authored Sep 3, 2024
2 parents 6226701 + e7f37e5 commit 53e499e
Show file tree
Hide file tree
Showing 6 changed files with 907 additions and 70 deletions.
74 changes: 67 additions & 7 deletions README_JP6.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Note: dev_dbg() log support will not be enabled by default. If needed, run the `
- kernel image (modified if `--dev-dbg` option is used while building): `images/6.0/rootfs/boot/Image`
- dtb: `images/6.0/rootfs/boot/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb`
- dtb overlay: `images/6.0/rootfs/boot/tegra234-camera-d4xx-overlay.dtbo`
- dtb dual camera overlay: `images/6.0/rootfs/boot/tegra234-camera-d4xx-overlay-dual.dtbo`
- nvidia-oot modules: `images/6.0/rootfs/lib/modules/5.15.136-tegra/updates`
- kernel modules: `images/6.0/rootfs/lib/modules/5.15.136-tegra/extra`

Expand All @@ -119,17 +120,20 @@ Following steps required:
1. Copy entire directory `images/6.0/rootfs/lib/modules/5.15.136-tegra/updates` from host to `/lib/modules/5.15.136-tegra/` on Orin target
2. Copy entire directory `images/6.0/rootfs/lib/modules/5.15.136-tegra/extra` from host to `/lib/modules/5.15.136-tegra/` on Orin target
3. Copy `tegra234-camera-d4xx-overlay.dtbo` from host to `/boot/tegra234-camera-d4xx-overlay.dtbo` on Orin target
4. Copy `tegra234-p3737-0000+p3701-0000-nv.dtb` from host to `/boot/` on Orin
5. Copy `Image` from host to `/boot/` on Orin (only if `--dev-dbg` option is enabled, else not needed as the kernel will be unmodified)
6. Run $ `sudo /opt/nvidia/jetson-io/jetson-io.py`
4. For dual camera, copy `tegra234-camera-d4xx-overlay-dual.dtbo` from host to `/boot/tegra234-camera-d4xx-overlay-dual.dtbo` on Orin target
5. Copy `tegra234-p3737-0000+p3701-0000-nv.dtb` from host to `/boot/` on Orin
6. Copy `Image` from host to `/boot/` on Orin (only if `--dev-dbg` option is enabled, else not needed as the kernel will be unmodified)
7. Run $ `sudo /opt/nvidia/jetson-io/jetson-io.py`
1. Configure Jetson AGX CSI Connector
2. Configure for compatible hardware
3. Jetson RealSense Camera D457
3. Choose appropriate configuration:
1. Jetson RealSense Camera D457
2. Jetson RealSense Camera D457 dual
4. Enable depmod scan for "extra" modules $ `sudo sed -i 's/search updates/search extra updates/g' /etc/depmod.d/ubuntu.conf`
5. $ `sudo depmod`
6. $ `echo "d4xx" | sudo tee /etc/modules-load.d/d4xx.conf`

7. Verify bootloader configuration
8. Verify bootloader configuration

```
cat /boot/extlinux/extlinux.conf
Expand All @@ -142,7 +146,7 @@ Following steps required:
OVERLAYS /boot/tegra234-camera-d4xx-overlay.dtbo
----<CUT>----
```
7. Reboot
9. Reboot
## Deploy build results on Jetson target
On build host, copy build results to the right places.
Expand All @@ -168,9 +172,12 @@ sudo cp ~/boot/tegra234-camera-d4xx-overlay.dtbo /boot/
sudo cp ./boot/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb /boot/tegra234-p3737-0000+p3701-0000-nv.dtb
# If "--dev-dbg" option is enabled, kernel will be modified. So, copy the 'Image' as well. If not enabled, no need to copy.
sudo cp ./boot/Image /boot/Image
# Enable d4xx overlay:
# Enable d4xx overlay for single camera:
sudo /opt/nvidia/jetson-io/config-by-hardware.py -n 2="Jetson RealSense Camera D457"

# For dual camera setup:
# sudo /opt/nvidia/jetson-io/config-by-hardware.py -n 3="Jetson RealSense Camera D457 dual"

# Enable d4xx autoload:
echo "d4xx" | sudo tee /etc/modules-load.d/d4xx.conf
# Enable depmod scan for "extra" modules
Expand Down Expand Up @@ -212,4 +219,57 @@ nvidia@ubuntu:~$ sudo dmesg | grep d4xx
[ 10.044759] d4xx 14-001a: D4XX Sensor: IMU, firmware build: 5.15.1.0

```
### Known issues
- Camera not recognized
Verify I2C MUX detected. If "probe failed" reported, replace extension board adapter (LI-JTX1-SUB-ADPT).
```
nvidia@ubuntu:~$ sudo dmesg | grep pca954x
[ 3.933113] pca954x 2-0072: probe failed
```
- Configuration with jetson-io tool system fail to boot with message "couldn't find root partition"
Verfiy bootloader configuration
`/boot/extlinux/extlinux.conf`
Sometimes configuration tool missing APPEND parameters. Duplicate `primary` section `APPEND` line to `JetsonIO` `APPEND` section, verify it's similar.
Exaple Bad:
```
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
INITRD /boot/initrd
APPEND ${cbootargs} root=PARTUUID=634b7e44-aacc-4dd9-a769-3a664b83b159 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0 nv-auto-config

LABEL JetsonIO
MENU LABEL Custom Header Config: <CSI Jetson RealSense Camera D457 dual>
LINUX /boot/Image
FDT /boot/dtb/kernel_tegra234-p3737-0000+p3701-0000-nv.dtb
INITRD /boot/initrd
APPEND ${cbootargs}
OVERLAYS /boot/tegra234-camera-d4xx-overlay-dual.dtbo
```
Exaple Good:
```
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
INITRD /boot/initrd
APPEND ${cbootargs} root=PARTUUID=634b7e44-aacc-4dd9-a769-3a664b83b159 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0 nv-auto-config

LABEL JetsonIO
MENU LABEL Custom Header Config: <CSI Jetson RealSense Camera D457 dual>
LINUX /boot/Image
FDT /boot/dtb/kernel_tegra234-p3737-0000+p3701-0000-nv.dtb
INITRD /boot/initrd
APPEND ${cbootargs} root=PARTUUID=634b7e44-aacc-4dd9-a769-3a664b83b159 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0 nv-auto-config
OVERLAYS /boot/tegra234-camera-d4xx-overlay-dual.dtbo
```
- Configuration tool jetson-io terminates without configuration menu.
verify that `/boot/dtb` has only one dtb file
```
nvidia@ubuntu:~$ ls /boot/dtb/
kernel_tegra234-p3737-0000+p3701-0000-nv.dtb
```
---
2 changes: 1 addition & 1 deletion apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if [ $1 = 'apply' ]; then
cp $DEVDIR/kernel/realsense/d4xx.c $DEVDIR/sources_$JETPACK_VERSION/${D4XX_SRC_DST}/drivers/media/i2c/
if [[ "$JETPACK_VERSION" == "6.0" ]]; then
# jp6 overlay
cp $DEVDIR/hardware/realsense/tegra234-camera-d4xx-overlay.dts $DEVDIR/sources_$JETPACK_VERSION/hardware/nvidia/t23x/nv-public/overlay/
cp $DEVDIR/hardware/realsense/tegra234-camera-d4xx-overlay*.dts $DEVDIR/sources_$JETPACK_VERSION/hardware/nvidia/t23x/nv-public/overlay/
else
cp $DEVDIR/hardware/realsense/$JP5_D4XX_DTSI $DEVDIR/sources_$JETPACK_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-camera-d4xx.dtsi
fi
Expand Down
2 changes: 1 addition & 1 deletion build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if [[ "$JETPACK_VERSION" == "6.0" ]]; then
make ARCH=arm64 dtbs
mkdir -p $TEGRA_KERNEL_OUT/rootfs/boot/dtb
cp $SRCS/nvidia-oot/device-tree/platform/generic-dts/dtbs/tegra234-p3737-0000+p3701-0000-nv.dtb $TEGRA_KERNEL_OUT/rootfs/boot/dtb/
cp $SRCS/nvidia-oot/device-tree/platform/generic-dts/dtbs/tegra234-camera-d4xx-overlay.dtbo $TEGRA_KERNEL_OUT/rootfs/boot/
cp $SRCS/nvidia-oot/device-tree/platform/generic-dts/dtbs/tegra234-camera-d4xx-overlay*.dtbo $TEGRA_KERNEL_OUT/rootfs/boot/
export INSTALL_MOD_PATH=$TEGRA_KERNEL_OUT/rootfs/
make ARCH=arm64 install -C kernel
make ARCH=arm64 modules_install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ Subject: [PATCH] overlay: enable d4xx camera for Orin jp6

Signed-off-by: Dmitry Perchanov <dmitry.perchanov@intel.com>
---
overlay/Makefile | 1 +
1 file changed, 1 insertion(+)
overlay/Makefile | 2 ++
1 file changed, 2 insertion(+)

diff --git a/overlay/Makefile b/overlay/Makefile
index c88bbe2..3f6354e 100644
--- a/overlay/Makefile
+++ b/overlay/Makefile
@@ -60,6 +60,7 @@ dtbo-y += tegra234-p3767-camera-p3768-imx219-A.dtbo
@@ -60,6 +60,8 @@ dtbo-y += tegra234-p3767-camera-p3768-imx219-A.dtbo
dtbo-y += tegra234-p3767-camera-p3768-imx219-imx477.dtbo
dtbo-y += tegra234-p3767-camera-p3768-imx477-C.dtbo
dtbo-y += tegra234-p3767-camera-p3768-imx477-A.dtbo
+dtbo-y += tegra234-camera-d4xx-overlay.dtbo
+dtbo-y += tegra234-camera-d4xx-overlay-dual.dtbo

ifneq ($(dtb-y),)
dtb-y := $(addprefix $(makefile-path)/,$(dtb-y))
Expand Down
Loading

0 comments on commit 53e499e

Please sign in to comment.