Difference between revisions of "Nvidia Jetson: Flashing Custom Firmware"
(→Flashing the Kernel) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 34: | Line 34: | ||
# Navigate out from the <code>sources</code> directory into the <code>Linux for Tegra</code>. | # Navigate out from the <code>sources</code> directory into the <code>Linux for Tegra</code>. | ||
# Use the <code>cp</code> to overwrite <code>./rootfs/usr/lib/modules/5.15.136-tegra/updates/nvgpu.ko</code> with <code>./source/kernel_out/nvgpu/drivers/gpu/nvgpu/nvgpu.ko</code>. | # Use the <code>cp</code> to overwrite <code>./rootfs/usr/lib/modules/5.15.136-tegra/updates/nvgpu.ko</code> with <code>./source/kernel_out/nvgpu/drivers/gpu/nvgpu/nvgpu.ko</code>. | ||
− | # Repeat the previous step to replace <code>Linux_for_Tegra/kernel/dtb/</code> with | + | # Repeat the previous step to replace <code>Linux_for_Tegra/kernel/dtb/</code> with </code>source/kernel_out/kernel/kernel-jammy-src/arch/arm64/boot/dts/nvidia</code>. Ensure that instead of overwriting the directory, only the files are copied over. |
+ | # Overwrite the Image file in <code>./kernel</code> with <code>./source/kernel_out/kernel/kernel-jammy-src/arch/arm64/boot/Image | ||
+ | </code>. | ||
# To specify the installation path for the compiled modules, use the command <code>export INSTALL_MOD_PATH=$HOME/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/rootfs/</code>. | # To specify the installation path for the compiled modules, use the command <code>export INSTALL_MOD_PATH=$HOME/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/rootfs/</code>. | ||
− | # Install modules using the command <code>./nvbuild -i</code>. | + | # Install modules using the command <code>./nvbuild -i</code>. The Jetson is now ready to be flashed. |
== Flashing the Kernel == | == Flashing the Kernel == | ||
− | + | Ensure that the target Jetson is connected to the host device and is in recovery mode. Navigate to the <code>Linux for Tegra</code> directory and run <code>sudo ./nvsdkmanager_flash.sh</code>. When prompted, disconnect the Jetson from host device and allow it to boot. Congratulations, you have successfully flashed your Jetson with custom firmware. |
Latest revision as of 19:56, 30 August 2024
Contents
Flashing Standard Firmware[edit]
SDKManager[edit]
SDKManager is available only on Linux, and can be installed here: https://developer.nvidia.com/sdk-manager
- Start up the SDKManager
- Put the Jetson into recovery mode. For the AGX, this can be done by pressing the recovery button while powering on the device. For the Nano and NX, however, a jumper will be required.
- Connect the Target Jetson to the host device and ensure that the target device is recognized.
- Follow the instructions on the application, choosing configurations as necessary.
Flashing Custom Firmware (For Jetson 36.3)[edit]
Pre-requisites[edit]
- Please install required packages with the command
sudo apt install build-essential bc && sudo apt install build-essential bc
.
Downloading the Toolchain[edit]
- Download the Toolchain binaries located in
https://developer.nvidia.com/embedded/jetson-linux
. - From there,
mkdir $HOME/l4t-gcc
,cd $HOME/l4t-gcc
and extract the installed toolchain into this newly created directory using thetar
command.
Downloading the Kernel[edit]
- Follow steps 1 to 3 as mentioned in Flashing Standard Firmware.
- Proceed to the second step of the SDKManager, where the respective individual dependencies and Jetson Images are listed and are to be installed. Proceed with the installation.
- When prompted to actually flash the Jetson, opt to skip. This will install the
nvidia
folder on your home directory, in which therootfs
,kernel
, andbootloader
are located. - Navigate to
nvidia
andcd
through its subdirectories, untilLinux for Tegra
is reached. - Inside
Linux for Tegra
,cd
into thesources
folder. It should be unpopulated with the exception of some bash scripts. Run thesource_sync.sh
script and when asked to specify the release tag of the downloadable sources, enterjetson_36.3
. This will install the sources for the respective Jetson version as necessary. To find the release tag of future iterations of the Jetson firmware, please refer to its respective release notes. - Once sources have been synced, the
sources
directory should now be populated with the required files.
Customizing Kernel[edit]
- Within
source
, enter thekernel
eventually navigate to thekernel-jammy-src
folder and runmake menuconfig ARCH=arm64
. This will bring up a UI with configurable drivers and peripherals. Select desired configurations and save. - The configurations can be found within a
.config
file located within the same directory. Copy the contents and locate thedefconfig
file in./arch/arm64/configs/
, overwriting it with the copied contents.
Building Custom Kernel and Installing Modules[edit]
- Navigate back out to
sources
. - Define the Cross-compilation toolchain with the commands
export CROSS_COMPILE=<toolchain-path>/bin/aarch64-buildroot-linux-gnu-
. If installation was done correctly as per the pre-requisites section, the commandexport CROSS_COMPILE=$HOME/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
should work. - Define the Cross-compilation toolchain with the commands
export CROSS_COMPILE_AARCH64_PATH=
, andexport CROSS_COMPILE_AARCH64=/bin/aarch64-buildroot-linux-gnu-
. (Potentially deprecated) - Inside the sources, directory, make an output directory for built kernel files using
mkdir kernel_out
. - Build the modules using the command
./nvbuild.sh -o kernel_out
. This will compile the drivers and device trees for the new kernel. - Navigate out from the
sources
directory into theLinux for Tegra
. - Use the
cp
to overwrite./rootfs/usr/lib/modules/5.15.136-tegra/updates/nvgpu.ko
with./source/kernel_out/nvgpu/drivers/gpu/nvgpu/nvgpu.ko
. - Repeat the previous step to replace
Linux_for_Tegra/kernel/dtb/
with source/kernel_out/kernel/kernel-jammy-src/arch/arm64/boot/dts/nvidia. Ensure that instead of overwriting the directory, only the files are copied over. - Overwrite the Image file in
./kernel
with./source/kernel_out/kernel/kernel-jammy-src/arch/arm64/boot/Image
.
- To specify the installation path for the compiled modules, use the command
export INSTALL_MOD_PATH=$HOME/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/rootfs/
. - Install modules using the command
./nvbuild -i
. The Jetson is now ready to be flashed.
Flashing the Kernel[edit]
Ensure that the target Jetson is connected to the host device and is in recovery mode. Navigate to the Linux for Tegra
directory and run sudo ./nvsdkmanager_flash.sh
. When prompted, disconnect the Jetson from host device and allow it to boot. Congratulations, you have successfully flashed your Jetson with custom firmware.