Compiling Jetson cboot sources

From RidgeRun Developer Wiki




Introduction

Sometimes changes need to be done to the cboot sources in order to generate a different cboot binary from the one that already comes in the JetPack SDK. This wiki page describes the steps that need to be done to compile the L4T cboot sources.

Get the sources

1. Identify the cboot sources tarball for your L4T version and download it. The latest cboot sources can be found at NVIDIA Jetson Linux web page, which contains all the L4T BSP sources.

2. Create a cboot directory to hold the extracted contents and extract the sources:

mkdir cboot
tar -xjf <cboot_source_tarball> -C cboot

Get the toolchain

A 64-bit ARM toolchain is required for cross compilation.

1. Get the toolchain tarball:

wget http://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz

2. Extract the contents:

tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz

3. Set the CROSS_COMPILE environment variable for cross compilation:

export CROSS_COMPILE=$PWD/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

Compile and install

1. Go the cboot directory and set the path environment variables:

cd cboot
export TEGRA_TOP=$PWD
export TOP=$PWD

2. Build the cboot binary:

  • For Jetson TX2:
make -C ./bootloader/partner/t18x/cboot PROJECT=t186 TOOLCHAIN_PREFIX="${CROSS_COMPILE}" DEBUG=2 BUILDROOT="${PWD}"/out NV_BUILD_SYSTEM_TYPE=l4t NOECHO=@
  • For Jetson Xavier:
make -C ./bootloader/partner/t18x/cboot PROJECT=t194 TOOLCHAIN_PREFIX="${CROSS_COMPILE}" DEBUG=2 BUILDROOT="${PWD}"/out NV_TARGET_BOARD=t194ref NV_BUILD_SYSTEM_TYPE=l4t NOECHO=@

After this step, the resulting binary will be in the following paths within the cboot directory:

  • ./out/build-t186/lk.bin for Jetson TX2.
  • ./out/build-t194/lk.bin for Jetson Xavier.

3. Rename the binary:

  • For Jetson TX2:
mv ./out/build-t186/lk.bin ./out/build-t186/cboot.bin
  • For Jetson Xavier:
mv ./out/build-t194/lk.bin ./out/build-t194/cboot_t194.bin

4. Replace the existing cboot binary with the compiled one:

  • For Jetson TX2:
mv ./out/build-t186/cboot.bin <Linux_For_Tegra directory path>/bootloader
  • For Jetson Xavier:
mv ./out/build-t194/cboot_t194.bin <Linux_For_Tegra directory path>/bootloader


For direct inquiries, please refer to the contact information available on our Contact page. Alternatively, you may complete and submit the form provided at the same link. We will respond to your request at our earliest opportunity.


Links to RidgeRun Resources and RidgeRun Artificial Intelligence Solutions can be found in the footer below.