Nvidia BSP Based on OpenEmbedded/The Yocto Project

Published

For some time now, MAB Labs has been helping one of our clients customize their Board Support Package (BSP) targeting a Nvidia Jetson Nano. Nvidia recommends using their JetPack SDK for all interactions with any Jetson-based board, including customizations and flashing. While components of the JetPack SDK can be selectively placed under our own source control, it is not necessary. In this blog post, we will discuss a BSP that MAB Labs has discovered that is a more suitable alternative, which is based on OpenEmbedded/The Yocto Project. The use of this BSP allows us to leverage the best practices that are typical for a BSP that is based on OpenEmbedded/The Yocto Project. We’re going to use the Jetson Nano eMMC as the hardware for the remainder of this blog post.

The BSP has been created based on OpenEmbedded/The Yocto Project. The layer that serves as the crux of the BSP is available on github at https://github.com/OE4T/meta-tegra. Now, this layer by itself isn’t necessarily an appropriate starting point, since it doesn’t have any reference images that can be used and customized. Instead, we will be using a complete reference BSP, also found on github at https://github.com/OE4T/tegra-demo-distro, which is based on the meta-tegra layer.

To get started, we can follow the instructions on the README of the github repository and execute the following commands. We’re going to use the hardknott branch since it’s the stable branch corresponding to the latest stable release of Linux For Tegra (i.e. L4T), which is 32.5.1):

$> git clone https://github.com/OE4T/tegra-demo-distro.git
$> cd tegra-demo-distro
$> git checkout --track remotes/origin/hardknott

We need to first decide which DISTRO and MACHINE we will be using for our BSP. The MACHINE will correspond to the System on Module (SoM) and corresponding board that will comprise our target hardware. We can execute the following command to get a list of the available options for DISTRO and MACHINE:

$> source ./setup-env --help

We get the following output after executing the above command:

Since we are using the Jetson Nano eMMC development kit, we are going to specify “jetson-nano-devkit-emmc” for the MACHINE variable, and we’re going to specify “tegrademo” for the DISTRO variable:

$> source ./setup-env --machine jetson-nano-devkit-emmc --distro tegrademo build-tegra

After we execute the above command, we will be presented with the following message: 

We are going to build the “demo-image-base” image. However, at the time of writing this blog post, the “bootlogo-custom” package that is included as part of this image was not at the location specified in the recipe. To rectify this matter, we will need to modify the local configuration to exclude the bootlogo-custom package from the image:

Finally, we can bitbake the demo-image-base image:

$> bitbake demo-image-base

Once bitbake is complete, we can navigate to the build directory “tmp/deploy/images/jetson-nano-devkit-emmc” and see the build outputs:

The build output that will be most relevant is “demo-image-base-jetson-nano-devkit-emmc.tegraflash.tar.gz”. We will decompress the tarball in a separate directory and view its contents:

The last step is to place the Jetson Nano developer kit in recovery mode (instructions can be found here: https://dev.to/asacasa/howto-recovery-mode-for-nvidia-jetson-nano-developer-kit-ceo), plug in the micro USB cable, power the board, and execute the following command to flash the board:

$> sudo ./doflash.sh

Once this process is complete, we should see output on the console port of the board as it’s booting up.