2328629_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2328629_en-US

2328629_en-US

[Beginner's Guide] How to Build Yocto Linux BSP - i.MX FRDM Board Edition (Japanese Blog)

This guide will show you how to build Yocto Linux using the i.MX FRDM board as a base.

This article uses the FRDM-IMX93 as an example, but the same procedure can be used to build on other i.MX FRDM boards.

The Yocto Linux BSP is described using "Linux 6.12.49_2.2.0 ( Yocto 5.2 “Walnascar” )" as an example.

Q: What is an i.MX FRDM board?

A: The i.MX FRDM board is a development board designed to be more affordable and compact compared to NXP's full-featured EVK board, with fewer features. Its purpose is to allow for easy basic evaluation and prototyping.


1. Environment & Preparation

1.1. environment

Major items Minor item Content remarks
Document -

IMX_YOCTO_PROJECT_USERS_GUIDE.pdf
(This is the primary method used. It describes the procedure for building the BSP
.)

i.MX Linux ® Release Notes
(You can view a list of support features.)

i.MX Porting Guide
(Summary of points to note when actually implementing)

Download general Yocto Linux documentation here.
Hardware FRDM board This chapter will use the FRDM-IMX93 as a basis for explanation.
Try PC
Ubuntu environment
・VMWare/Virtual Box etc. (on Windows)
Native Linux
one of the following
Recommended: Ubuntu 22.04 or later
SD card + reader/writer 16GB or more recommended  

Hardware

(Option)

MIPI-Camera

(Option)

BSP-compatible MIPI camera
(See i.MX Linux ® Release Notes)
A USB camera can be used as an alternative (though this may result in latency).

Display

(Option)

Display  

USB Device

(Option)

USB mouse, USB memory stick  

Headphone

(Option)

3.5mm earphones

Earphones with a microphone (such as the earphones that came with older iPhones) are better.
Software Yocto environment Linux BSP
(This time, we used Linux 6.12.49_2.2.0 ( Yocto 5.2 “Walnascar” ))
This article explains the installation process, including how to install the software.

1.2. Legend

Legend for the Command Prompt

=>           u-bootプロンプト
$            BSPがインストールされているLinux PCのプロンプト

2. Host machine

Ubuntu 22.04 Desktop is recommended. For practical use, a host machine with at least 8 threads and 16GB of RAM is recommended for a reasonably comfortable experience. The required storage will vary depending on the target recipe, but it will be around 50GB for small projects and 500GB for larger ones.

2.1. Packages required for Yocto

Please install the necessary packages using the following steps.

$ sudo apt-get install build-essential chrpath cpio debianutils diffstat file gawk
gcc git iputils-ping libacl1 liblz4-tool locales python3 python3-git python3-
jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xzutils zstd efitools curl

Note: In addition to the information in IMX_YOCTO_PROJECT_USERS_GUIDE.pdf, curl has been added.

2.2. Configuring the swap file
Here's an example of setting up a 32GB swap file.

$ sudo fallocate -l 32G /swapfile
$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile
$ sudo swapon /swapfile

Note: If /swapfile already exists, the command on the first line will fail. If you want to change the size, execute the following and then run the command above again.

$ sudo swapoff /swapfile
$ sudo rm /swapfile

To automatically mount the swap file when the host machine starts up, add the following line to /etc/fstab :

/swapfile none swap sw 0 0


3. Yocto Linux BSP

From the Embedded Linux for i.MX Applications Processors section on nxp.jp, select the required Linux BSP version and obtain the i.MX Yocto Project User's Guide.

Yocto User Guide.jpg

Create the image following the steps in "4 Yocto Project Setup" of the i.MX Yocto Project User's Guide (IMXLXYOCTOUG).

This document is written assuming the following settings are used to generate the image.

DISTRO = fsl-imx-xwayland
MACHINE = imx93-11x11-lpddr4x-frdm


3.1. Setting up and building Yocto BSP
For host machine setup, please refer to 2. Host Machine.

3.1.1. Installing the repo utility

$ mkdir ~/bin
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

3.1.2. Add the repository to your PATH
Add the following line to $HOME/.bashrc :

export PATH=~/bin:$PATH

3.1.3. Git Setup

$ git config --global user.name "Your Name"
$ git config --global user.email "Your Email"
$ git config --list

3.1.4. Yocto BSP Setup

$ mkdir imx-yocto-bsp
$ cd imx-yocto-bsp
$ repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-walnascar -m imx-6.12.49-2.2.0.xml
$ repo sync

3.1.5. Set build target, build

$ MACHINE=imx93-11x11-lpddr4x-frdm DISTRO=fsl-imx-xwayland source ./imx-setup-release.sh -b build
$ bitbake imx-image-full

*Once the build is complete, a Linux image will be generated.

* For instructions on how to write the generated image, please refer to steps 1 and 2 of the Start Guide for your specific FRDM board.


Note: If you want to build a Linux BSP for other FRDM boards, replace the " MACHINE= " part of the command above with the following name.

  • imx8mp-lpddr4-frdm (FRDM-IMX8MPLUS)
  • imx91-11x11-lpddr4-frdm (FRDM-IMX91)
  • imx91-11x11-lpddr4-frdm-imx91s (FRDM-IMX91S)
  • imx93-11x11-lpddr4x-frdm (FRDM-IMX93)
  • imx95-15x15-lpddr4x-frdm (FRDM-IMX95)

Note: For graphics functionality, you can also select the distribution using the " DISTRO = " part of the command above.

  • fsl-imx-wayland (Wayland)
  • fsl-imx-xwayland (Not compatible with X11 apps that use Wayland & X11 *EGL)


Note: The setup using the imx-setup-release.sh script should only be done once per project. Doing so on an existing project will generate new files such as conf/local.conf , and your previous settings will be lost. If you wish to reuse an existing project... 3.3.1. See "Resuming work from an existing build directory".

Note: Depending on the host machine's specifications, the build process may take several tens of hours. Also, expect it to consume 400-500GB of storage.

Note: When building on a multi-core, multi-threaded host machine, swapping occurs if there is insufficient memory for the number of threads. Limiting the number of threads is covered in section 3.4.2. See Limiting the number of threads that run during the build process.

Note: In the initial state of Ubuntu 22.04, swap may not be configured, which can cause extreme slowness or crashes. The swap file configuration is as follows: 2.2. Please refer to the section on configuring swap files.


*The following information is for reference only.

3.2. Building and Installing the Toolchain
You can build and install toolchains such as cross-compilers. By using the scripts generated here, you can avoid problems that often occur during cross-compilation, such as not being able to find include files or libraries to link.

3.2.1. Toolchain build

$ bitbake imx-image-full -c populate_sdk

3.2.2. install

$ tmp/deploy/sdk/fsl-imx-xwayland-glibc-x86_64-imx-image-full-armv8a-imx93-11x11-lpddr4x-pf0900-evk-toolchain-6.12-walnascar.sh

We will not explain how to use the toolchain here.


3.3. Frequently used Yocto bitbake commands and settings

3.3.1. Resume work from the existing build directory.

$ cd /path/to/imx-yocto-bsp
$ source ./setup-environment build

Note: The paths and directories mentioned here are from section 3.1.4. Yocto BSP setup, 3.1.5. The build target settings were configured during the build process.

Below, we will give some command examples using linux-imx as an example. You can do the same thing for each package by changing " linux-imx " to a different package name.

3.3.2. Rebuilding the package

$ bitbake -c compile linux-imx -f
$ bitbake -c install linux-imx
$ bitbake -c deploy linux-imx

If you do not include the note -f , the steps may be skipped.

Note - Some packages may show an error when deploying using `-c deploy` , but in most cases this is simply because the `do_deploy` command is not available, so you can ignore the error.

3.3.3. Deleting Packages
If an error occurs with a package that shouldn't normally happen, try deleting the package using the following command and trying again. This may resolve the error. (This is because packages may be corrupted during download, or junk data may remain if the build process is terminated prematurely.)

$ bitbake -c cleansstate linux-imx

Note: The extracted source code will be deleted, so please be careful if you have any files you are currently editing.

3.3.4. Package Extraction
If you only want to extract the package and do not want to compile it yet

$ bitbake -c patch linux-imx

3.3.5. Apply changes to the config file.
If you want to change a config file (such as arch/arm64/configs/imx_v8_defconfig ) and have those changes reflected:

$ bitbake -c configure linux-imx
$ bitbake -c compile linux-imx -f

3.3.6. Run linux-imx menuconfig
When changing the build options for the Linux kernel

$ bitbake -c menuconfig linux-imx

A window like this will pop up, so make the necessary changes and save. (Use the arrow keys to select the item and the spacebar to confirm.)


For tips on building, please also refer to the following article.


=========================

We are currently unable to respond to comments left in the "Comment" section of this post.
We apologize for the inconvenience, but please refer to " Technical Questions to NXP - How to Contact Us( Japanese Blog) " when making an inquiry.
(If you are already an NXP distributor or have a relationship with NXP, you may ask your representative directly.)

This guide will show you how to build a Linux BSP using the FRDM (Freedom) board, which allows you to start using embedded Linux in a compact and affordable way.

This article uses the FRDM-IMX93 as an example, but the same procedure can be used to build on other i.MX FRDM boards.

The Yocto Linux BSP is described using "Linux 6.12.49_2.2.0 (Yocto 5.0.4)" as an example.

i.MX ProcessorsSW | DownloadsJapanese Blog
タグ(1)
評価なし
バージョン履歴
最終更新日:
‎03-15-2026 11:30 PM
更新者: