====== Jetson Orin NX Development ======
==== Jetson Linux 35.4.1 Source Download ====
[[https://developer.nvidia.com/embedded/jetson-linux-r3541|NVIDIA Jetson Linux 35.4.1]]
==== NVIDIA Jetson developer kit quick start guide ====
[[https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/IN/QuickStart.html|Quick Start Guide]]
==== Boot Architecture ====
[[https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/AR/BootArchitecture.html|Boot Architecture]]
==== Download SDKmanager in Host(X86 PC) ====
[[https://developer.nvidia.com/sdk-manager|SDK Manager]]
==== Jetson Orin NX and Nano Series Documents ====
[[https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/HR/JetsonModuleAdaptationAndBringUp/JetsonOrinNxNanoSeries.html#hr-jetsonmoduleadaptationandbringup-jetsonorinnxnanoseries|Jetson NX & Nano Document]]
==== Jetson Linux Toolchain ====
[[https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/AT/JetsonLinuxToolchain.html#at-jetsonlinuxtoolchain|Linux Compiler Toolchain]]
==== Jetson DP HDMI porting ====
[[https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/SD/Kernel/DisplayConfigurationAndBringUp.html|DP HDMI porting]]
==== Jetson Building UEFI ====
[[https://github.com/NVIDIA/edk2-nvidia/wiki/Build-with-docker|Build UEFI with Docker]] \\
[[https://github.com/NVIDIA/edk2-nvidia/wiki/Build-without-docker|Build UEFI without Docker]]
==== Build Environment ====
sudo apt update
sudo apt upgrade --> Keep 20.04
sudo apt install make
sudo apt install build-essential bc
sudo apt install libncurses-dev
sudo apt install flex
sudo apt install bison -y
sudo apt install libssl-dev
sudo apt install libelf-dev
sudo apt install qemu-user-static
==== Across Compiler ====
mkdir $HOME/l4t-gcc
cd $HOME/l4t-gcc
cp ../Download/aarch64--glibc--stable-final.tar.gz ~/l4t-gcc/.
tar xf aarch64--glibc--stable-final.tar.gz
==== Create BSP Method 1 ====
export L4T_RELEASE_PACKAGE=Jetson_Linux_R35.4.1_aarch64.tbz2
export SAMPLE_FS_PACKAGE=Tegra_Linux_Sample-Root-Filesystem_R35.4.1_aarch64.tbz2
export BOARD=jetson-orin-nano-devkit
tar xf ${L4T_RELEASE_PACKAGE}
sudo tar xpf ${SAMPLE_FS_PACKAGE} -C Linux_for_Tegra/rootfs/
tar xf public_sources.tbz2 --> decompress the file to Linux_for_Tegra/source/public
cd Linux_for_Tegra/
sudo ./apply_binaries.sh
sudo ./tools/l4t_flash_prerequisites.sh
cd source/public
tar -xjf kernel_src.tbz2
==== Create BSP Method 2 ====
tar xf Jetson_Linux_R35.4.1_aarch64.tbz2
sudo tar xpf Tegra_Linux_Sample-Root-Filesystem_R35.4.1_aarch64.tbz2 -C Linux_for_Tegra/rootfs/
cd Linux_for_Tegra/
sudo ./apply_binaries.sh
sudo ./tools/l4t_flash_prerequisites.sh --> Installing the Flash Requirements
cd source/public
tar –xjf kernel_src.tbz2
==== Flashing the Target Device ====
1. Put the target device into Force Recovery Mode.
A. Power on the carrier board and hold down the RECOVERY button.
B. Press the RESET button.
{{:jetson_orin_nx.png?400|}}
{{:jetson_som_configuration.png|}}
2. Using Standard flash
sudo ./flash.sh jetson-orin-nano-devkit-nvme internal
3. Jetson Orin Nano Developer Kit (NVMe):
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
-c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal
4. Jetson Orin Nano Developer Kit (USB):
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device sda1 \
-c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal
5. Jetson Orin Nano Developer Kit (SD card):
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device mmcblk1p1 \
-c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internalls
==== Build Kernel ====
export CROSS_COMPILE_AARCH64_PATH=$HOME/l4t-gcc/
export CROSS_COMPILE_AARCH64=$HOME/l4t-gcc/bin/aarch64-buildroot-linux-gnu-
cd ~/workspace/NX/Linux_for_Tegra/source/public
mkdir kernel_out
./nvbuild.sh -o $PWD/kernel_out
==== Config Kernel ====
~/workspace/NX/Linux_for_Tegra/source/public/kernel/kernel-5.10
make menuconfig
==== Vmware Tools =====
sudo apt update
sudo apt upgrade
sudo apt install open-vm-tools-desktop -y
sudo reboot
==== VSCode install =====
[[https://code.visualstudio.com/download|Vscode download link]]
==== Nvidia Tegra Partition Layout - NVME ====
/home/ubuntu/workspace/DEV2715/Linux_for_Tegra/bootloader/t186ref/cfg/flash_t234_qspi_nvme.xml
==== Kernel Customization ====
[[https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/SD/Kernel/KernelCustomization.html|Kernel Customization]]\\
After you compiled your kernel, please update below files!\\
source/public/kernel_out/drivers/gpu/nvgpu/nvgpu.ko -->
Linux_for_Tegra/rootfs/usr/lib/modules/$(uname -r)/kernel/drivers/gpu/nvgpu/nvgpu.ko
source/public/kernel_out/arch/arm64/boot/dts/nvidia/ -->
Linux_for_Tegra/kernel/dtb/
source/public/kernel_out/arch/arm64/boot/Image -->
Linux_for_Tegra/kernel/Image
==== How to confirm which dts file is used ====
cat /proc/device-tree/nvidia,dtsfilename
==== Flash DTB File ====
sudo ./flash.sh -r -k DTB jetson-nano-qspi-sd mmcblk0p1
==== Device Tree Documents ====
/home/ubuntu/workspace/DEV2715/Linux_for_Tegra/source/public/kernel/kernel-5.10/Documentation/devicetree/bindings
==== Flash definition ====
/home/ubuntu/workspace/DEV2715/Linux_for_Tegra/bootloader/t186ref/cfg/flash_t234_qspi_nvme.xml
==== DTB & DTS ====
(1) dts to dtb
./dtc -I dts -O dtb -o output_name.dtb input_name.dts
(2) dtb to dts
./dtc -I dtb -O dts -o output_name.dts input_name.dtb
==== To flash the target device to mount a rootfs specified by UUID ====
sudo ./flash.sh internal
bootloader/l4t-rootfs-uuid.txt
sudo ./flash.sh external
bootloader/l4t-rootfs-uuid.txt_ext