Jump to content

Compiling Jetson TX2 source code: Difference between revisions

m
no edit summary
No edit summary
mNo edit summary
Line 1: Line 1:
<seo title="Nvidia Tegra X2 | Compiling Tegra X2 Source Code | RidgeRun" titlemode="replace" keywords="GStreamer, Linux SDK, Linux BSP,  Embedded Linux, Device Drivers, Nvidia, Jetson, TX1, TX2, Xilinx, TI, NXP, Freescale, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework."  description="Find instructions to download Tegra source code to rebuild the Jetson TX2 images. Learn about compiling Tegra X2 source code with RidgeRun Developer."></seo>
<seo title="Nvidia Tegra X2 | Compiling Tegra X2 Source Code | RidgeRun" titlemode="replace" keywords="GStreamer, Linux SDK, Linux BSP,  Embedded Linux, Device Drivers, Nvidia, Jetson, TX1, TX2, Xilinx, TI, NXP, Freescale, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework."  description="Find instructions to download Tegra source code to rebuild the Jetson TX2 images. Learn about compiling Tegra X2 source code with RidgeRun Developer."></seo>


= Newest Jetpack Versions (Jetpack 3.1 and later) =
== Newest Jetpack Versions (Jetpack 3.1 and later) ==


For newest Jetpack versions please reference this wiki page: [[Compiling_Tegra_X1/X2_source_code]]. In case you are going to use Jetpack 3.0 continue in this page.
For newest Jetpack versions please reference this wiki page: [[Compiling_Tegra_X1/X2_source_code]]. In case you are going to use Jetpack 3.0 continue in this page.


= Introduction =
== Introduction ==


In this wiki page you are going to find the instructions to download the source code to rebuild the Jetson TX2 images using jetpack, several parts of this wiki were based in the document called Start_L4T_Docs.html given by Nvidia in L4T. This Nvidia Tegra X2 page should be considered a work in progress. These steps were run on Jetson TX2.<br>
In this wiki page you are going to find the instructions to download the source code to rebuild the Jetson TX2 images using jetpack, several parts of this wiki were based in the document called Start_L4T_Docs.html given by Nvidia in L4T. This Nvidia Tegra X2 page should be considered a work in progress. These steps were run on Jetson TX2.<br>
Line 17: Line 17:
</pre>
</pre>


= Download kernel code =
== Download kernel code ==


==Option 1 Manually Download and Expand==
===Option 1 Manually Download and Expand===
<span style="background:#00FF00"> RECOMMENDED </span>
<span style="background:#00FF00"> RECOMMENDED </span>


Line 40: Line 40:
</pre>
</pre>


==Option 2 Sync with git==
===Option 2 Sync with git===


Let's call $JETPACKDIR the path where you installed your development directory or Jetpack.
Let's call $JETPACKDIR the path where you installed your development directory or Jetpack.
Line 123: Line 123:
</pre>
</pre>


= Toolchain =
== Toolchain ==


==Option 1==
===Option 1===


<span style="background:#00FF00"> RECOMMENDED </span>
<span style="background:#00FF00"> RECOMMENDED </span>
Line 141: Line 141:
</pre>
</pre>


==Option 2==
===Option 2===


1) Download the pre-built toolchain binaries from the Embedded Download Center on the NVIDIA Developer page at:
1) Download the pre-built toolchain binaries from the Embedded Download Center on the NVIDIA Developer page at:
Line 168: Line 168:
</pre>
</pre>


= Kernel =
== Kernel ==


In order to compile the kernel please follow these steps
In order to compile the kernel please follow these steps


== Build Kernel ==
=== Build Kernel ===




Line 219: Line 219:
</pre>
</pre>


== Flash your Kernel image using Jetpack 3.0 root file system==
=== Flash your Kernel image using Jetpack 3.0 root file system===


'''1.''' Install jetpack 3.0: http://developer.ridgerun.com/wiki/index.php?title=Installing_Jetpack_3.0
'''1.''' Install jetpack 3.0: http://developer.ridgerun.com/wiki/index.php?title=Installing_Jetpack_3.0
Line 293: Line 293:
Username and password: nvidia. You can see the ipaddress connecting a keyboard, mouse and monitor to the board at this point since ubuntu would be already booted.
Username and password: nvidia. You can see the ipaddress connecting a keyboard, mouse and monitor to the board at this point since ubuntu would be already booted.


== DTB ==
=== DTB ===


Looking into the file $JETPACKDIR/64_TX2/Linux_for_Tegra_tx2/jetson-tx2.conf the dtb used by jetson x1 is: '''tegra186-a02-bpmp-quill-p3310-1000-a00-00-te770d-ucm2.dtb'''
Looking into the file $JETPACKDIR/64_TX2/Linux_for_Tegra_tx2/jetson-tx2.conf the dtb used by jetson x1 is: '''tegra186-a02-bpmp-quill-p3310-1000-a00-00-te770d-ucm2.dtb'''
Line 333: Line 333:
</pre>
</pre>


= Bootloader =
== Bootloader ==


The bootloader is a combination of NVIDIA T-Boot (nvtboot) and U-Boot. You can read about the BOOT FLOW in the [http://http.download.nvidia.com/tegra-public-appnotes/t210-nvtboot-flow.html nvtboot wiki page].  
The bootloader is a combination of NVIDIA T-Boot (nvtboot) and U-Boot. You can read about the BOOT FLOW in the [http://http.download.nvidia.com/tegra-public-appnotes/t210-nvtboot-flow.html nvtboot wiki page].  
Line 345: Line 345:
Inside of the bootloader directory you will find several binaries or components, to get a description of these please read the [http://http.download.nvidia.com/tegra-public-appnotes/t210-nvtboot-flow.html nvtboot wiki page].
Inside of the bootloader directory you will find several binaries or components, to get a description of these please read the [http://http.download.nvidia.com/tegra-public-appnotes/t210-nvtboot-flow.html nvtboot wiki page].


== Build DTC ==
=== Build DTC ===


U-boot requires the Device Tree Compiler (dtc) which is used to compile device tree files contained in the U-Boot source tree. One version is included inside of the kernel. However, that binary is too old according to u-boot when trying to use that one
U-boot requires the Device Tree Compiler (dtc) which is used to compile device tree files contained in the U-Boot source tree. One version is included inside of the kernel. However, that binary is too old according to u-boot when trying to use that one
Line 365: Line 365:
</pre>
</pre>


== Build u-boot ==
=== Build u-boot ===


1. Backup original uboot files. You see which platform you are using checking the file in $/64_TX2/Linux_for_Tegra_tx2/jetson-tx2.conf, it says:
1. Backup original uboot files. You see which platform you are using checking the file in $/64_TX2/Linux_for_Tegra_tx2/jetson-tx2.conf, it says:
Line 431: Line 431:
If you are attached to the serial port while flashing you should see the [http://developer.ridgerun.com/wiki/index.php?title=Jetson_TX1_serial_port_output serial port output log while flashing]
If you are attached to the serial port while flashing you should see the [http://developer.ridgerun.com/wiki/index.php?title=Jetson_TX1_serial_port_output serial port output log while flashing]


== Boot sequence ==
=== Boot sequence ===


According to the U-boot guide provided by Nvidia uboot scans booteable devices as follows:
According to the U-boot guide provided by Nvidia uboot scans booteable devices as follows:
Line 451: Line 451:
extlinux.conf is a standard text-format sysboot configuration file that contains all boot information, it is installed in /boot according to the boot method.
extlinux.conf is a standard text-format sysboot configuration file that contains all boot information, it is installed in /boot according to the boot method.


== Boot log and uboot environment ==
=== Boot log and uboot environment ===


Following [http://developer.ridgerun.com/wiki/index.php?title=Jetson_TX1_Boot_Log boot log] was obtained when connected to the serial console using the [http://developer.ridgerun.com/wiki/index.php?title=Jetson_TX1_uboot_environment default uboot environment].
Following [http://developer.ridgerun.com/wiki/index.php?title=Jetson_TX1_Boot_Log boot log] was obtained when connected to the serial console using the [http://developer.ridgerun.com/wiki/index.php?title=Jetson_TX1_uboot_environment default uboot environment].
Line 457: Line 457:
The environment is defined in extlinux.conf, however, the environment variables can be set in the uboot code directly or directly when the board is booting using the typical uboot commands like: print, saveenv, printenv, etc
The environment is defined in extlinux.conf, however, the environment variables can be set in the uboot code directly or directly when the board is booting using the typical uboot commands like: print, saveenv, printenv, etc


= Filesystem =
== Filesystem ==


Jetpack comes with a sample filesystem with X and ubuntu and Canonical keeps updating the packages available, you can also use your own filesystem. In both cases you have to install on it the Nvidia binaries, the instructions to do that are in the file Start_L4T_Docs.html, in the Getting started section. It mentions:
Jetpack comes with a sample filesystem with X and ubuntu and Canonical keeps updating the packages available, you can also use your own filesystem. In both cases you have to install on it the Nvidia binaries, the instructions to do that are in the file Start_L4T_Docs.html, in the Getting started section. It mentions:
Line 477: Line 477:
The remaining steps on this guide assumes that you are using the default filesytem or that you already have one built, specially for the flashing section, where flashing assumes that the filesystem already exists.
The remaining steps on this guide assumes that you are using the default filesytem or that you already have one built, specially for the flashing section, where flashing assumes that the filesystem already exists.


== To receive notifications of new packages ==
=== To receive notifications of new packages ===


1. Locate and edit the following file:
1. Locate and edit the following file:
Line 501: Line 501:
  $ sudo apt-get install wget
  $ sudo apt-get install wget


= Flashing the board =
== Flashing the board ==


Nvidia provides several scripts to help to generate the images and to flash the resulting images. Including if you are going to install uboot or fastboot. First the board needs to be in recovery mode and then the main script to flash it is $JETPACK/64_TX2/Linux_for_Tegra_tx2/flash.sh. What this script will do is to install or flash the image in the desired destination. It is important that the script is controlled by variables defined in the DTB file.
Nvidia provides several scripts to help to generate the images and to flash the resulting images. Including if you are going to install uboot or fastboot. First the board needs to be in recovery mode and then the main script to flash it is $JETPACK/64_TX2/Linux_for_Tegra_tx2/flash.sh. What this script will do is to install or flash the image in the desired destination. It is important that the script is controlled by variables defined in the DTB file.
Line 662: Line 662:
</pre>
</pre>


= Serial Console =
== Serial Console ==


J21 contains the Serial Console signals as can be seen in the [http://jetsonhacks.com/nvidia-jetson-tx1-j21-header-pinout/ pin out header]. Basically:
J21 contains the Serial Console signals as can be seen in the [http://jetsonhacks.com/nvidia-jetson-tx1-j21-header-pinout/ pin out header]. Basically:
Line 673: Line 673:


There is a [http://jetsonhacks.com/2015/12/01/serial-console-nvidia-jetson-tx1/ nice video with details].
There is a [http://jetsonhacks.com/2015/12/01/serial-console-nvidia-jetson-tx1/ nice video with details].
= References =


= Articles related  =
= Articles related  =
Cookies help us deliver our services. By using our services, you agree to our use of cookies.