9
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?

AtomVM Raspberry Pi Picoのファームをビルドしてブートを高速化する

Last updated at Posted at 2025-11-25

はじめに

AtomVM Raspberry Pi Picoの標準ファームはシリアル(USB)接続の待機で20秒待ちます

この待機時間を1秒にしたファームを作ります

結論

ファームを作る時にAVM_USB_WAIT_SECONDSを1秒を指定してビルドします

AtomVM公式

公式サイト
https://doc.atomvm.org/

GitHub

ビルド環境

  • GPD MicroPC2
    • CPU intel Core i3 N300
    • RAM 16GB
    • SSD 512GB
  • OS Ubuntu 24.04

アプリインストール

$ sudo apt install gcc-arm-none-eabi
$ sudo apt install cmake
$ sudo apt install ninja-build

ビルド

公式のビルド方法

ソースを取得

$ git clone https://github.com/atomvm/AtomVM.git
$ cd AtomVM

Raspberry Pi Picoのファームビルド

$ cd src/platforms/rp
$ mkdir build
$ cd build
$ cmake .. -G Ninja -DAVM_USB_WAIT_SECONDS=1
$ ninja

公式と比べてcmakeの引数に
-DAVM_USB_WAIT_SECONDS=1
を追加がポイントです

2025/11/25時点ではcmakeでエラーがでます
対処方法は下記に書きます

cmakeでエラー対策

Raspberry Pi Pico SDKで下記のエラーがでます

CMake Error at build/_deps/pico_sdk-src/docs/CMakeLists.txt:2 (if):
  if given arguments:

    "PICO_SDK_TOP_LEVEL_PROJECT" "AND"

  Unknown arguments specified

CMakeLists.txtを修正します

build/_deps/pico_sdk-src/docs/CMakeLists.txt
 find_package(Doxygen QUIET)
- if (PICO_SDK_TOP_LEVEL_PROJECT AND ${DOXYGEN_FOUND})
+ if (PICO_SDK_TOP_LEVEL_PROJECT AND DOXYGEN_FOUND)
     set(PICO_BUILD_DOCS_DEFAULT 1)
  endif()

### 省略 ###

${DOXYGEN_FOUND}の部分がエラーの原因です
DOXYGEN_FOUNDに修正します

再度cmakeを実行

$ cmake .. -G Ninja -DAVM_USB_WAIT_SECONDS=1

成功すると下記が表示します

Downloading Picotool
-- Configuring done (5.5s)
-- Generating done (0.1s)
-- Build files have been written to: /home/user/local/AtomVM/src/platforms/rp2/build

その後ninjaを実行してください

$ ninja

Raspberry Pi Picoにファームを転送

src/platforms/rp2/build/src/AtomVM.uf2にファームが出来上がります
これをRaspberry Pi Picoに転送します

転送方法はこのコラムを参考にしてください

9
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
9
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?