From c4d1c08b40f33cdd5de5f47a2f8368301abcd0d9 Mon Sep 17 00:00:00 2001 From: Arun-Prasad-V Date: Thu, 25 Jul 2024 14:59:29 +0530 Subject: [PATCH 1/4] Enabling dev_dbg() logs support for JP5 --- build_all.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build_all.sh b/build_all.sh index 031e354b..8143078a 100755 --- a/build_all.sh +++ b/build_all.sh @@ -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) @@ -69,6 +75,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 From 1aeea5c09991482b21d48ecc2c26018c94bb3706 Mon Sep 17 00:00:00 2001 From: Arun-Prasad-V Date: Sat, 27 Jul 2024 14:46:59 +0530 Subject: [PATCH 2/4] Enabling dev_dbg() logs support for JP6 --- build_all.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/build_all.sh b/build_all.sh index 8143078a..988d501f 100755 --- a/build_all.sh +++ b/build_all.sh @@ -48,7 +48,20 @@ 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 + make ARCH=arm64 defconfig + scripts/config --enable DYNAMIC_DEBUG + scripts/config --enable DYNAMIC_DEBUG_CORE + make ARCH=arm64 savedefconfig + cp defconfig ./arch/arm64/configs/custom_defconfig + rm defconfig .config + make ARCH=arm64 mrproper + cd $SRCS + make ARCH=arm64 KERNEL_DEF_CONFIG=custom_defconfig -C kernel + else + make ARCH=arm64 -C kernel + fi make ARCH=arm64 modules make ARCH=arm64 dtbs mkdir -p $TEGRA_KERNEL_OUT/rootfs/boot/dtb From 16e402195f156cf55e94631271dfd264950377b1 Mon Sep 17 00:00:00 2001 From: Arun-Prasad-V Date: Sat, 27 Jul 2024 15:10:35 +0530 Subject: [PATCH 3/4] Updated Readme --- README_JP5.md | 8 ++++++++ README_JP6.md | 16 +++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README_JP5.md b/README_JP5.md index 9aeb949e..15075918 100644 --- a/README_JP5.md +++ b/README_JP5.md @@ -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 +``` @@ -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 diff --git a/README_JP6.md b/README_JP6.md index 4c425399..bb7429e7 100644 --- a/README_JP6.md +++ b/README_JP6.md @@ -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 +``` @@ -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` @@ -112,7 +120,8 @@ 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 @@ -120,7 +129,7 @@ Following steps required: 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 @@ -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" From 6085c8008aea40853464ebe43c6c1c26d9cf4327 Mon Sep 17 00:00:00 2001 From: Arun-Prasad-V Date: Wed, 31 Jul 2024 15:12:43 +0530 Subject: [PATCH 4/4] Added comments --- build_all.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build_all.sh b/build_all.sh index 988d501f..82837da6 100755 --- a/build_all.sh +++ b/build_all.sh @@ -50,16 +50,23 @@ if [[ "$JETPACK_VERSION" == "6.0" ]]; then ln -sf $TEGRA_KERNEL_OUT $SRCS/out 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