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

buildrootでlvgl(2)

Last updated at Posted at 2025-04-09

目的

組み込み(arm linux)環境でlvglを使用したアプリを作成する

前回lvgl公式のサンプルを使用したので
今回は普通にbuildrootのメインブランチから自前アプリを追加して動作確認する

確認環境

  • fedora(rawhide:20250304) + xfce
  • qemu 9.2.0

commit idなど

対象 id
buildroot(base) https://buildroot.org/downloads/buildroot-2025.02.tar.gz
lvgl dcf934d8ef23c1764ac8e4207bde0ad27cc95969

手順

ボード毎の設定を作成

他のボードを参考に board/[group名]/[board名]/ にファイルを作成します

また config/[board名]_defconfigも作成します
とりあえずはそれっぽい何かのコピーで良いと思います

作成したら

make [board名]_defconfig

で読み込みます

menuconfig

make menuconfig

を実行して、ボード毎の設定を反映させていきます
また、ドライバやアプリの設定を行ないます

パッケージの追加

ここなどを参考にパッケージを追加します

lvglを使用したアプリの場合はアプリ毎にlvglが必要になると思います

ビルド

make

でビルドを行います

エラーが発生したらここなどを参考に
ビルドエラーを解消します

configの保存

無事にビルドが通ったら

make [board名]_defconfigで読み込んだboard毎の設定ファイルを更新します

make savedefconfig

サンプル

ということで

とそれを使用するためにbuildroot側に設定変更などを行なった

を作成しました

サンプルの実行手順

ビルドツールなどのインストール

多分初めてbuildrootに触れる人以外は不要と思います

sudo yum group install -y development-tools
sudo yum install -y git qemu edk2-aarch64 g++ cmake ninja-build gtk3-devel python3-pip autoconf aclocal makeinfo gnutls-devel mupdf-devel libevdev-devel SDL2-devel SDL2_image-devel

ダウンロードとビルド

git clone --depth=1 -b pdf-viewer https://github.com/tyano463/buildroot_aarch64.git
git checkout 01f9d6c218975bbdc84e7a94f56e4297ec346a04
make rock4cp_defconfig
make

bios(uefi)作成

truncate -s 64m varstore.img
truncate -s 64m efi.img
dd if=/usr/share/edk2/aarch64/QEMU_EFI.fd of=efi.img conv=notrunc

実行(qemu)

sudo qemu-system-aarch64 -M virt -cpu cortex-a710 -m 2048 \
 -kernel output/images/Image \
 -device virtio-gpu -display gtk,show-cursor=on \
 -append "root=/dev/vda console=ttyS0" \
 -drive if=pflash,format=raw,file=efi.img,readonly=on \
 -drive if=pflash,format=raw,file=varstore.img \
 -drive file=./output/images/rootfs.ext2,if=virtio,format=raw \
 -netdev tap,ifname=tap0,script=no,downscript=no,id=my_net_id \
 -device driver=virtio-net,netdev=my_net_id \
 -device qemu-xhci \
 -serial stdio \
 -device usb-mouse -device usb-kbd -device usb-tablet

こんな感じで表示されます

pdf_viewer_lvgl.gif

その他

project creatorはlinuxだと
以下のような感じでまったく動かないんだけど
windowsの人は動くんだろうか、、、

$ ./LVGLProjectCreator.AppImage 
Command-line arguments: []
UI requested manifest content
[1849676:0409/180757.144941:ERROR:select_file_dialog_linux_portal.cc(770)] Portal returned error: org.freedesktop.DBus.Error.AccessDenied: Portal operation not allowed: Unable to open /proc/1849676/root
Error reading file: Error: ENOENT: no such file or directory, open '/home/tyano/Downloads/lvgl/undefined/lv_conf.h'
    at Object.readFileSync (node:fs:448:20)
    at t.readFileSync (node:electron/js2c/node_init:2:10175)
    at /tmp/.mount_LVGLPrH81Bcm/resources/app.asar/out/main/index.js:166:26
    at WebContents.<anonymous> (node:electron/js2c/browser_init:2:83740)
    at WebContents.emit (node:events:519:28) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/tyano/Downloads/lvgl/undefined/lv_conf.h'
}
0
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
0
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?