I.MX8 Deep Learning Reference Designs - Environment Setup

From RidgeRun Developer Connection
Jump to: navigation, search


NXP Partner Program Registered Vertical.jpg NXP Partner Program Horizontal.jpg


Previous: Getting_Started Index Next: Getting_Started/Evaluating the Project






Download repository

This repository contains the recipes, scripts, and configuration files needed for the system setup.

git clone https://gitlab.ridgerun.com/ridgerun/rnd/imx8-ai-reference-design.git
  • Note: This repository must be substituted with the repository provided once the product is purchased

System Setup

In order to set up an empty yocto project to build the custom image for the imx8 execute the following steps:

1. Define a directory path to hold your Yocto build and set a variable for it:

mkdir path/to/yocto_for_imx8
YOCTO_DIR=<path/to/yocto_for_imx8>

2. Enter the cloned repository and run the setup script, this will use the local manifest file to set the required meta-layers for the specific configuration:

./scripts/setup-repo.sh $YOCTO_DIR

3. Initialize the Yocto environment with the custom script for the imx8:

cd $YOCTO_DIR
export TEMPLATECONF=${PWD}/sources/meta-imx8-ai-ref/conf
source imx8-setup.sh -b imx8_build

5. Build the custom image

bitbake core-image-imx8-ai-ref
  • Note: To return to this build environment later please run:
cd $YOCTO_DIR
source setup-environment imx8_build

Flashing the image into SD card

Finding the built image

Once the bitbake command has finished, then it is possible to take the image and install it on a SD card.

Inside $YOCTO_DIR/imx8_build/tmp/deploy/images/imx8mp-var-dart you will find the created image. So go there by doing:

cd $YOCTO_DIR/imx8_build/tmp/deploy/images/imx8mp-var-dart

Explore the files and find the required ones:

find *.wic.gz

The command written above will show all the files that contains those extensions on their names.

The result should be something like this:

core-image-imx8-ai-ref-imx8mp-var-dart-20220818165330.rootfs.wic.gz
core-image-imx8-ai-ref-imx8mp-var-dart.wic.gz

Transferring the image into the SD card

Plug in the SD card into your Host machine and execute the following commands in order to know the path on which the SD card has been mounted:

lsblk

This command will show all the mounted devices in your computer, so it will be easier to know if your device has partitions or any data. Normally, the SD card will be mounted by those names:

  • /dev/sdb
  • /dev/sdc
  • /dev/mmcblk0

For this case, we will call the SD card as /dev/sdX

Unmount the SD card

In order to install the image, you will need to unmount every partition of the SD card (if it has one), by doing this command for each partition:

sudo umount /dev/sdXn

Where the n means that this command is needed for every partition.

Flashing the SD with bmaptools

Assign to these parameters some values:

  • DEVICE
  • IMAGE

In this case fill those parameters as follows:

DEVICE=/dev/sdX

IMAGE=core-image-imx8-ai-ref-imx8mp-var-dart.wic.gz

NOTE: Replace the DEVICE name with the corresponding name in your case.

After doing this, we are able to start the flashing process, by doing the following command:

sudo bmaptool copy $IMAGE $DEVICE --nobmap

After this process has been done, then eject the SD.




Previous: Getting_Started Index Next: Getting_Started/Evaluating the Project