Jetson Nano – How to customize u-boot

Jetson Nano

This article describes how to customize u-boot. It explains how to get the u-boot source code, build u-boot, and write the u-boot image to Jetson Nano. About u-boot see this article.

u-boot source code

The following work is done in Linux_for_Tegra. See this article about the Linux_for_Tegra directory.

There is a script named source_sync.sh in the Linux_for_Tegra directory. This is a script that downloads the source code, and we can see that u-boot is downloaded from the nv-tegra.nvidia.com/3rdparty/u-boot.git repository.

$ git clone https://nv-tegra.nvidia.com/3rdparty/u-boot.git
$ cd u-boot
$ git tag | grep 32.7
tegra-l4t-r32.7.1Code language: Bash (bash)

We can see that there is a tag named tegra-l4t-r32.7.1 in the u-boot repository. Check out this tag.

git checkout tegra-l4t-r32.7.1Code language: Bash (bash)

Now we have the u-boot source code.

build u-boot

We need to install gcc for arm to build u-boot. It can be retrieved from https://developer.nvidia.com/embedded/dlc/l4t-gcc-7-3-1-toolchain-64-bit at https://developer.nvidia.com/embedded/linux-tegra-r3272. Extract the downloaded gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz, under /opt this time.

$ sudo tar xf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
$ ls /opt
gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnuCode language: Bash (bash)

Try to build u-boot.

export CROSS_COMPILE=/opt/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
make distclean
make p3541-0000_defconfig
make -jCode language: Bash (bash)

update u-boot

Write the u-boot built to Jetson Nano by specifying jetson-nano-qspi instead of jetson-nano-devkit as a parameter of flash.sh. As explained in this article and this article, u-boot is stored in on board flash, so it is enough to rewrite QSPI-NOR in on board flash, and rewriting SD Card is unnecessary. Of course, there is no problem if you specify jetson-nano-devkit and rewrite both on board flash and SD Card.

cp u-boot{,.bin,.dtb,-dtb.bin} ../bootloader/t210ref/p3450-0000/
cd ..
sudo ./flash.sh -x 0x21 jetson-nano-qspi mmcblk0p1Code language: Bash (bash)

Check the output of the Jetson Nano’s UART. Refer to this article for details on how to connect UART.

U-Boot 2020.04 (Sep 24 2022 - 17:06:08 +0900)

SoC: tegra210
...Code language: CSS (css)

The u-boot we just built is now running.

That’s all.