1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ZephyrRTOS を改めて導入してみる

Last updated at Posted at 2025-12-01

去年のアドベントカレンダーでの僕のチャレンジは、いろいろトラブルがあってうまくいきませんでした。
今年改めて一からやり直してみます。

環境

  • ターゲット ESP32 DevkitV1
  • 母艦 Ubuntu 24.04 LTS
$ cmake --version
cmake version 3.28.3
$ python3 --version
Python 3.12.3
$ dtc --version
Version: DTC 1.7.0

みなさんが書いていただいた前回のアドベントカレンダーでは、何故か ESP32 がありませんでしたね。僕も、ESP32 で Wi-Fi を動かすのが難儀そうであったので選択から外しました。
それから1年。そろそろどうかな?

導入

ZephyrRTOS は特に指定しなければ、導入方法はターゲットデバイスがどれかにかかわらず同じです。
でも一応、ターゲットスペフィックなところがあるかどうか懸念があるので、いちおうターゲット毎に説明されているページ

https://www.zephyrproject.org/zephyr-rtos-on-esp32/
ここを読んでやってきます。
タイムスタンプが April 13, 2021 とありますが、大丈夫かな・・・

The generic Zephyr Getting Started Guide can be used to set up the development environment, with only a few ESP32-specific steps.

https://docs.zephyrproject.org/latest/develop/getting_started/index.html

After the “Install the Zephyr SDK” step, fetch and update the binary blobs needed to build the Wi-Fi

ということで、本記事では下記の記事を実施していきます。

事前に、 sudo apt update と sudo apt upgrade をスマsておきました。

空き容量

前回は母艦のストレージが足りずにえらく苦労しました。今回は以下のように十分空きを確保。

$ df -h
...
/dev/nvme0n1p2  233G  117G  105G  53% /
...

インストール

$ sudo apt install --no-install-recommends git cmake ninja-build gperf \
  ccache dfu-util device-tree-compiler wget python3-dev python3-venv python3-tk \
  xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1
$ python3 -m venv ~/zephyrproject/.venv
$ source ~/zephyrproject/.venv/bin/activate
(.venv) 
$ pip install west
$ west init ~/zephyrproject
$ cd ~/zephyrproject
$ west update
$ west zephyr-export
$ cd ~/zephyrproject/zephyr
$ west sdk install

ここから、各ボードごとの設定や、ターゲットボード指定してビルドをしていくことになります。

インストールに必要な苦労

ここまでで大体30分弱でした

$ df -h
...
/dev/nvme0n1p2  233G  137G   85G  62% /
...

ストレージに20Gぐらい消費していました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?