概要
FRDM i.mx95を試す。
nfs起動して見るのと、OpenAMPに慣れるのが目的。
ビルドマシンはUbuntu24.04を使用。
火入れ
の通りにeMMCモードで電源を入れる。
/dev/ttyACM0のポートで、Linuxのログが出る。
imx95-15x15-lpddr4x-frdm login: root
root@imx95-15x15-lpddr4x-frdm:~# uname -a
Linux imx95-15x15-lpddr4x-frdm 6.18.2-1.0.0-gf49f45233f7b #1 SMP PREEMPT Wed Feb 11 18:37:47 UTC 2026 aarch64 GNU/Linux
6.18なので、かなり新しい。
ちなみに、HDMI先にはYoctoのスプラッシュ→Westonのデスクトップが表示される。
次はこのバージョンのYocto Linuxをビルドしてみる。
BSPビルドのマニュアル
ここに使えるBSP Linuxの一覧がある。
今回は6.18を参照
Dockerコンテナを作る
この手順通りにDockerを作ると、以下のエラーになることがある。
> [ 9/10] RUN groupadd -g 1000 nxp && useradd -g 1000 -m -s /bin/bash -u 1000 xxx: 0.150 groupadd: GID '1000' already exists
〜
ERROR: failed to solve: process "/bin/sh -c groupadd -g $host_gid nxp && useradd -g $host_gid -m -s /bin/bash -u $host_uid $USER" did not complete successfully: exit code: 4
これは、ホストとコンテナでuid/gid 1000が重複しているので出る。
なので、
Dockerfile-Ubuntu-24.04
の該当箇所を以下に変える。hogeはhostの自ユーザに読み替えること。
ARG host_uid=1000
ARG host_gid=1000
ARG USER=hoge
RUN set -eux; \
if ! getent group ${host_gid} >/dev/null; then \
groupadd -g ${host_gid} nxp; \
fi; \
existing_user="$(getent passwd ${host_uid} | cut -d: -f1 || true)"; \
if [ -n "$existing_user" ]; then \
usermod -l ${USER} "$existing_user"; \
usermod -d /home/${USER} -m ${USER}; \
else \
useradd -m -s /bin/bash -u ${host_uid} -g ${host_gid} ${USER}; \
fi
./docker-build.sh Dockerfile-Ubuntu-24.04
./docker-run.sh
これで、コンテナに入れる。
Yocto ビルド
まずはパッケージインストール
sudo apt update
sudo apt-get install build-essential chrpath cpio debianutils diffstat file gawk gcc git iputils-ping libacl1 libcrypt-dev locales python3 python3-git python3-jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils zstd efitools
repo
mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
cd imx-6.18.2-1.0.0
mkdir imx-yocto-bsp
cd imx-yocto-bsp
repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-wrynose -m imx-6.18.20-2.0.0.xml
repo sync
ビルド
DISTRO=fsl-imx-xwayland MACHINE=imx95-15x15-lpddr4x-frdm \
source imx-setup-release.sh -b build-xwayland
bitbake imx-image-multimedia
or
bitbake imx-image-full
約半日かかって、ビルドが完了した。
次回は、sdカードでの起動と、nfs起動を試す。
トラブルシュート
onnxruntimeのエラー
CMake Error at gsl-subbuild/gsl-populate-prefix/src/gsl-populate-stamp/download-gsl-populate.cmake:163 (message):
Each download failed! error: downloading 'https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.zip' failed status_code: 22 status_string: "HTTP response code said error"
こういうエラーが起きた。
手動でzipを取得して、再ビルドで回避した。
wget -O v4.0.0.zip https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.zip
cp v4.0.0.zip \
/opt/yocto/imx-6.18.2-1.0.0/imx-yocto-bsp/build-xwayland/tmp/work/armv8-2a-mx95-poky-linux/onnxruntime/1.24.3/build/_deps/gsl-subbuild/gsl-populate-prefix/src/
bitbake onnxruntime -c compile -f
bitbake onnxruntime
bitbake imx-image-full