Difference between revisions of "Compiling Jetson cboot sources"

From RidgeRun Developer Connection
Jump to: navigation, search
(Compile and install)
m
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
<seo title="Compiling Jetson cboot sources | Jetson cboot | RidgeRun" titlemode="replace" keywords="GStreamer, Linux SDK, Linux BSP,  Embedded Linux, Device Drivers, NVIDIA, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework, Jetson, TX1, TX2, Jetson TX1, Jetson TX2, Tegra, Nano, Jetson Nano, Xavier, Xavier NX, Jetson Xavier, cboot, L4T cboot, cboot sources, L4T cboot sources"  description="This wiki page describes the steps that need to be done to compile the L4T cboot sources."></seo>
 +
 +
<table>
 +
<tr>
 +
<td><div class="clear; float:right">__TOC__</div></td>
 +
<td>
 +
{{NVIDIA Preferred Partner logo}}
 +
<td>
 +
<center>
 +
{{ContactUs Button}}
 +
</center>
 +
</tr>
 +
</table>
 +
 
== Introduction ==
 
== Introduction ==
  
Some times 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.
+
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 ==
 
== Get the sources ==
  
'''IMPORTANT:''' The cboot sources for Jetson Nano are not yet released as of November 2021.
+
{{Ambox
 +
|type=notice
 +
|small=left
 +
|issue='''IMPORTANT:''' The cboot sources for Jetson Nano are not yet released as of November 2021.
 +
|style=width:unset;
 +
}}
  
'''1.''' Identify the cboot sources tarball for your L4T version and download it. The latest cboot sources can be found at Nvidia's [https://developer.nvidia.com/embedded/linux-tegra Jetson Linux web page], which contains all the L4T BSP sources.  
+
'''1.''' Identify the cboot sources tarball for your L4T version and download it. The latest cboot sources can be found at NVIDIA [https://developer.nvidia.com/embedded/linux-tegra 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:  
 
'''2.''' Create a '''cboot''' directory to hold the extracted contents and extract the sources:  
Line 34: Line 53:
 
'''3.''' Set the <code>CROSS_COMPILE</code> environment variable for cross compilation:  
 
'''3.''' Set the <code>CROSS_COMPILE</code> environment variable for cross compilation:  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
export CROSS_COMPILE=./gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
+
export CROSS_COMPILE=$PWD/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 40: Line 59:
 
'''1.''' Go the '''cboot''' directory and set the path environment variables:
 
'''1.''' Go the '''cboot''' directory and set the path environment variables:
  
'''IMPORTANT:''' Make sure your current top directory's path is not made up of symbolic links.
+
{{Ambox
 +
|type=notice
 +
|small=left
 +
|issue='''IMPORTANT:''' Make sure your current top directory's path is not made up of symbolic links.
 +
|style=width:unset;
 +
}}
  
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
Line 84: Line 108:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
'''4.''' Replace the existing cboot binary with compiled one:
+
'''4.''' Replace the existing cboot binary with the compiled one:
  
 
* For Jetson TX2:
 
* For Jetson TX2:
Line 95: Line 119:
 
mv ./out/build-t194/cboot_t194.bin <Linux_For_Tegra directory path>/bootloader
 
mv ./out/build-t194/cboot_t194.bin <Linux_For_Tegra directory path>/bootloader
 
</syntaxhighlight>
 
</syntaxhighlight>
 
  
 
{{ContactUs}}
 
{{ContactUs}}
  
[[Category:Jetson]]
+
[[Category:Jetson]][[Category:JetsonTX2]][[Category:NVIDIA Xavier]][[Category:JetsonNano]]

Latest revision as of 02:57, 22 August 2022

Nvidia-preferred-partner-badge-rgb-for-screen.png

RR Contact Us.png

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


RidgeRun Resources

Quick Start Client Engagement Process RidgeRun Blog Homepage
Technical and Sales Support RidgeRun Online Store RidgeRun Videos Contact Us

OOjs UI icon message-progressive.svg Contact Us

Visit our Main Website for the RidgeRun Products and Online Store. RidgeRun Engineering informations are available in RidgeRun Professional Services, RidgeRun Subscription Model and Client Engagement Process wiki pages. Please email to support@ridgerun.com for technical questions and contactus@ridgerun.com for other queries. Contact details for sponsoring the RidgeRun GStreamer projects are available in Sponsor Projects page. Ridgerun-logo.svg
RR Contact Us.png