Difference between revisions of "Yocto Support for NVIDIA Jetson Platforms - Setting up Yocto"

From RidgeRun Developer Connection
Jump to: navigation, search
m
Line 18: Line 18:
 
|TX2
 
|TX2
 
|jetson-tx2-devkit
 
|jetson-tx2-devkit
|jetson-tx2-devkit-tx2i'''*'''
+
|jetson-tx2-devkit-tx2i
 
|jetson-tx2-devkit-4gb'''*'''
 
|jetson-tx2-devkit-4gb'''*'''
 
|-
 
|-
 
|XAVIER
 
|XAVIER
|jetson-agx-xavier-devkit'''*'''
+
|jetson-agx-xavier-devkit
|jetson-agx-xavier-devkit-8gb'''*'''
 
 
|
 
|
 
|-
 
|-
 
|NANO
 
|NANO
 
|jetson-nano-devkit
 
|jetson-nano-devkit
|jetson-nano-devkit-emmc'''*'''
+
|jetson-nano-devkit-emmc
|
+
|jetson-nano-2gb-devkit'''*'''
 
|-
 
|-
 
|XAVIER NX
 
|XAVIER NX
 
|jetson-xavier-nx-devkit'''*'''
 
|jetson-xavier-nx-devkit'''*'''
 
|jetson-xavier-nx-devkit-emmc'''*'''
 
|jetson-xavier-nx-devkit-emmc'''*'''
|
+
|jetson-xavier-nx-devkit-tx2-nx'''*'''
 
|-  
 
|-  
 
!colspan="5"|Note: the machines with * have NOT been tested by RidgeRun yet
 
!colspan="5"|Note: the machines with * have NOT been tested by RidgeRun yet
Line 54: Line 53:
 
</source>
 
</source>
  
3. Select the latest branch (as per May 2020)
+
3. Select the latest stable branch (as per May 2020)
  
 
<source lang="bash">
 
<source lang="bash">
Line 67: Line 66:
 
</source>
 
</source>
  
5. {{Download}} Download meta-tegra
+
5. {{Download}} Download meta-tegra (contains L4T 32.6.1 as per March 2022)
  
 
<source lang="bash">
 
<source lang="bash">
git clone -b ${BRANCH}-l4t-r32.5.0 https://github.com/madisongh/meta-tegra.git
+
git clone -b ${BRANCH} https://github.com/OE4T/meta-tegra.git
 
</source>
 
</source>
  
Line 89: Line 88:
 
* Add the name of your target platform <MACHINE>.
 
* Add the name of your target platform <MACHINE>.
 
* Set IMAGE_CLASSES and IMAGE_FSTYPES to easily flash the target board.
 
* Set IMAGE_CLASSES and IMAGE_FSTYPES to easily flash the target board.
* Set 3.6 as the ''python3'' and ''python3-native'' preferred version.
 
 
{{Ambox
 
|type=notice
 
|small=left
 
|issue='''The python recipes are NOT included in the main meta-tegra repository yet.'''
 
|style=width:unset;
 
}}
 
  
 
'''Note:''' Replace <MACHINE> with your selected machine (don't delete the quotes "")
 
'''Note:''' Replace <MACHINE> with your selected machine (don't delete the quotes "")
Line 109: Line 100:
 
SSTATE_DIR ?= "/home/${USER}/Yocto/sstate_dir"
 
SSTATE_DIR ?= "/home/${USER}/Yocto/sstate_dir"
 
DL_DIR ?= "/home/${USER}/Yocto/downloads"
 
DL_DIR ?= "/home/${USER}/Yocto/downloads"
 
PREFERRED_VERSION_python3 = "3.6%"
 
PREFERRED_VERSION_python3-native = "3.6%"
 
 
</source>
 
</source>
  

Revision as of 16:25, 21 March 2022



  Index Next: Flashing the Jetson Platform


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



Select your Machine

You can apply the instructions in this wiki for multiple devices, so, whenever you see <MACHINE>, replace it (with the <> symbols included) with your target platform. Below you will find the possible <MACHINE> substitutions.

Device <MACHINE>
TX1 jetson-tx1-devkit
TX2 jetson-tx2-devkit jetson-tx2-devkit-tx2i jetson-tx2-devkit-4gb*
XAVIER jetson-agx-xavier-devkit
NANO jetson-nano-devkit jetson-nano-devkit-emmc jetson-nano-2gb-devkit*
XAVIER NX jetson-xavier-nx-devkit* jetson-xavier-nx-devkit-emmc* jetson-xavier-nx-devkit-tx2-nx*
Note: the machines with * have NOT been tested by RidgeRun yet

Install Dependencies

1. Use the following command to install Yocto dependencies on Ubuntu.

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm

2. Create a working directory for Yocto

YOCTO_DIR=/home/$USER/yocto-tegra
mkdir $YOCTO_DIR

3. Select the latest stable branch (as per May 2020)

export BRANCH="dunfell"

4. Download alt font awesome.svg Download Yocto's Poky base meta-layer

cd $YOCTO_DIR
git clone -b ${BRANCH} git://git.yoctoproject.org/poky.git poky-${BRANCH}

5. Download alt font awesome.svg Download meta-tegra (contains L4T 32.6.1 as per March 2022)

git clone -b ${BRANCH} https://github.com/OE4T/meta-tegra.git

Compile Yocto image

1. Initialize the build environment

cd $YOCTO_DIR
source poky-${BRANCH}/oe-init-build-env build

2. Setup the required settings

local.conf

  • Open the file $YOCTO_DIR/build/conf/local.conf with your favorite text editor and append the following lines to the end of the file.
  • Setup the SSTATE and DOWNLOADS directories with a custom path to avoid re-downloading and re-compiling in the future.
  • Add the name of your target platform <MACHINE>.
  • Set IMAGE_CLASSES and IMAGE_FSTYPES to easily flash the target board.

Note: Replace <MACHINE> with your selected machine (don't delete the quotes "")

MACHINE ?= "<MACHINE>"

DISTRO_FEATURES = "x11 opengl "

IMAGE_CLASSES += "image_types_tegra"
IMAGE_FSTYPES = "tegraflash"

SSTATE_DIR ?= "/home/${USER}/Yocto/sstate_dir"
DL_DIR ?= "/home/${USER}/Yocto/downloads"

Optional: By default, Yocto uses all the available cores and threads of the computer. If you want to limit the resources used on the build, you can add the following lines to your $YOCTO_DIR/build/conf/local.conf file. Change the parameters according to your needs and to your host machine specification.

BB_NUMBER_THREADS = '6'
PARALLEL_MAKE = '-j6'

bblayers.conf

Open the file $YOCTO_DIR/build/conf/bblayers.conf with your favorite text editor and add the meta-tegra layer to the build/conf/bblayers.conf file to load the provided recipes:

 BBLAYERS ?= " \         
  /home/${USER}/yocto-tegra/meta-tegra \                                                                                                                                                                                                                                                                                                                                                                
  /home/${USER}/yocto-tegra/poky-dunfell/meta \       
  /home/${USER}/yocto-tegra/poky-dunfell/meta-poky \                                                                                                                                                                
  /home/${USER}/yocto-tegra/poky-dunfell/meta-yocto-bsp \                                                                                                                                                                                                                                                                                                    
  "

3. Build the image

Use an image with developer tools such as GStreamer, NVIDIA plugins, etc

bitbake core-image-sato-dev

Or you can choose a different image from the following table

<IMAGE>
core-image-sato-dev
core-image-weston
core-image-base

Legacy instructions

Please visit the following links for older versions of Jetpack.


  Index Next: Flashing the Jetson Platform