Skip to content

Commit

Permalink
Merge pull request IntelRealSense#220 from Arun-Prasad-V/dev_dbg
Browse files Browse the repository at this point in the history
Enabling dev_dbg() logs support for JP5 & JP6
  • Loading branch information
Nir-Az authored Aug 1, 2024
2 parents a5e8ae8 + 6085c80 commit b1eb164
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
8 changes: 8 additions & 0 deletions README_JP5.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ sudo apt install build-essential bc flex bison
# build kernel, dtb and D457 driver
./build_all.sh 5.0.2 ./Linux_for_Tegra/source/public
```
Note: dev_dbg() log support will be enabled by default. If not needed, run the `./build_all.sh` script with `--no-dev-dbg` option like below.
```
./build_all.sh --no-dev-dbg 5.0.2 ./Linux_for_Tegra/source/public
```

</details>

Expand All @@ -91,6 +95,10 @@ The developers can set up the source code with NVIDIA's Jetson git repositories
./build_all.sh 5.0.2
```
Note: dev_dbg() log support will be enabled by default. If not needed, run the `./build_all.sh` script with `--no-dev-dbg` option like below.
```
./build_all.sh --no-dev-dbg 5.0.2
```

## Install kernel, device-tree and D457 driver to Jetson AGX Xavier

Expand Down
16 changes: 13 additions & 3 deletions README_JP6.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ cd realsense_mipi_platform_driver
./apply_patches.sh apply 6.0
./build_all.sh 6.0
```
Note: dev_dbg() log support will be enabled by default. If not needed, run the `./build_all.sh` script with `--no-dev-dbg` option like below.
```
./build_all.sh --no-dev-dbg 6.0
```



Expand Down Expand Up @@ -80,9 +84,13 @@ cd ../..
# build kernel, dtb and D457 driver
./build_all.sh 6.0 ./Linux_for_Tegra/source
```
Note: dev_dbg() log support will be enabled by default. If not needed, run the `./build_all.sh` script with `--no-dev-dbg` option like below.
```
./build_all.sh --no-dev-dbg 6.0 ./Linux_for_Tegra/source
```

## Archive JetPack 6.0 build results (optional) on build host
- kernel image (not modified): `images/6.0/rootfs/boot/Image`
- kernel image (not modified if `--no-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`
- nvidia-oot modules: `images/6.0/rootfs/lib/modules/5.15.136-tegra/updates`
Expand Down Expand Up @@ -112,15 +120,16 @@ Following steps required:
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. Run $ `sudo /opt/nvidia/jetson-io/jetson-io.py`
5. Copy `Image` from host to `/boot/` on Orin
6. 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
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`

6. Verify bootloader configuration
7. Verify bootloader configuration

```
cat /boot/extlinux/extlinux.conf
Expand Down Expand Up @@ -157,6 +166,7 @@ sudo cp -r ~/extra /lib/modules/$(uname -r)/
sudo cp -r ~/updates /lib/modules/$(uname -r)/
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
sudo cp ./boot/Image /boot/Image
# Enable d4xx overlay:
sudo /opt/nvidia/jetson-io/config-by-hardware.py -n 2="Jetson RealSense Camera D457"

Expand Down
33 changes: 31 additions & 2 deletions build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
set -e

if [[ "$1" == "-h" ]]; then
echo "build_all.sh [JetPack_version] [JetPack_Linux_source]"
echo "build_all.sh [--no-dev-dbg] [JetPack_version] [JetPack_Linux_source]"
echo "build_all.sh -h"
exit 1
fi

DEVDBG=1
if [[ "$1" == "--no-dev-dbg" ]]; then
DEVDBG=0
shift
fi

export DEVDIR=$(cd `dirname $0` && pwd)
NPROC=$(nproc)

Expand Down Expand Up @@ -42,7 +48,27 @@ if [[ "$JETPACK_VERSION" == "6.0" ]]; then
cd $SRCS
export KERNEL_HEADERS=$SRCS/kernel/kernel-jammy-src
ln -sf $TEGRA_KERNEL_OUT $SRCS/out
make ARCH=arm64 -C kernel
if [[ "$DEVDBG" == "1" ]]; then
cd $KERNEL_HEADERS
# Generate .config file from default defconfig
make ARCH=arm64 defconfig
# Update the CONFIG_DYNAMIC_DEBUG and CONFIG_DEBUG_CORE flags in .config file
scripts/config --enable DYNAMIC_DEBUG
scripts/config --enable DYNAMIC_DEBUG_CORE
# Convert the .config file into defconfig
make ARCH=arm64 savedefconfig
# Save the new generated file as custom_defconfig
cp defconfig ./arch/arm64/configs/custom_defconfig
# Remove unwanted
rm defconfig .config
make ARCH=arm64 mrproper
cd $SRCS
# Building the Image with custom_defconfig
make ARCH=arm64 KERNEL_DEF_CONFIG=custom_defconfig -C kernel
else
# Building the Image with default defconfig
make ARCH=arm64 -C kernel
fi
make ARCH=arm64 modules
make ARCH=arm64 dtbs
mkdir -p $TEGRA_KERNEL_OUT/rootfs/boot/dtb
Expand All @@ -69,6 +95,9 @@ else
#jp4/5
cd $SRCS/$KERNEL_DIR
make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig
if [[ "$DEVDBG" == "1" ]]; then
scripts/config --file $TEGRA_KERNEL_OUT/.config --enable DYNAMIC_DEBUG
fi
make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j${NPROC}
make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=$KERNEL_MODULES_OUT
fi
Expand Down

0 comments on commit b1eb164

Please sign in to comment.