Skip to content

Yboichuk/feat/remove pio - #140

Open
black-ghost-off wants to merge 5 commits into
mainfrom
yboichuk/feat/remove_pio
Open

black-ghost-off wants to merge 5 commits into
mainfrom
yboichuk/feat/remove_pio

Conversation

@black-ghost-off

Copy link
Copy Markdown
Member

Replace PlatformIO with a native ESP-IDF build

Keira now builds as a native ESP-IDF CMake project: ESP-IDF v4.4.7 with arduino-esp32 2.0.17 used as an IDF component. That's the same IDF and Arduino core PlatformIO used before, now built from source. Every dependency is a git submodule pinned to an exact tag or commit, so builds are reproducible and don't depend on registry resolution.

This is the first step toward dropping Arduino entirely and moving Lilka v3 (ESP32-S3.1) to ESP-IDF 6.1+. Lilka v1 support is removed.

Layout

src/                 Keira itself, as an IDF component (src/CMakeLists.txt)
components/<name>/   one IDF component per library: our CMakeLists.txt + the upstream submodule inside
                     (lilka/sdk, arduino, esp-dsp, Arduino_GFX, U8g2, lua, nofrendo, ...)
components/mJS, components/SimpleFTPServer   vendored libs, moved from lib/
boards/lilka_v2/     board.cmake (target + IDF version pin), sdkconfig.defaults, partitions.csv
data/spiffs/         internal filesystem image (make flash-fs)
data/img, data/assets   README images and splash sources (not flashed)
docs/addons/         Lua language-server addon (was addons/)

Pinned versions

Component | Version -- | -- ESP-IDF | v4.4.7 (the build fails on any other version) arduino-esp32 | 2.0.17 Lilka SDK | v2.5.15 (needed for lilka/partitions.h) Arduino_GFX | v1.6.0 U8g2 | 2.35.9 (ca1caf3) ArduinoJson | v7.0.4 ESPTelnet | 2.2.1 ESP8266Audio | 2.2.0 AnimatedGIF | 2.1.0 JPEGDEC | 1.8.4 Lua (arduino-lua) | v0.1.1 nofrendo | a5a5c1a TinyUSB / esp-dsp | same commits as the prebuilt Arduino core

Library sources are identical to what PlatformIO resolved, except files that PlatformIO's prep script modified. NimBLE was dropped: nothing includes it, so nothing from it was ever linked.

Keeping behavior the same

  • sdkconfig: taken from the prebuilt Arduino esp32s3 config (the qio_opi variant) and minimized. It matches the old build except for the Lilka-specific values: 16 MB flash, custom partition table and octal PSRAM initialized at boot.
  • Compiler settings are the same as before: -Os, gnu++11, exceptions on, no RTTI. -Werror=all is disabled because the code was never built with it.
  • SDK version: LILKA_SDK_VERSION pins the reported SDK version (the git tag ships a 0.0.0/Dev placeholder that hides the boot splash). Configure fails if it doesn't match the submodule tag.
  • On hardware: Wi-Fi, NVS, SD and the display were checked on a Lilka v2. I compared it with a PlatformIO build of main on the same device, and the known boot errors (LEDC is not initialized, the first-boot SD card type error) also occur there.

Building

git clone --recurse-submodules --shallow-submodules https://github.com/lilka-dev/keira
make docker-build        # pinned espressif/idf:v4.4.7 image, no local toolchain needed
make docker-flash PORT=/dev/ttyACM0
make docker-monitor PORT=/dev/ttyACM0

make build flash monitor # with a local ESP-IDF v4.4.7 (plus its own CMake 3.x; CMake 4 is rejected)

  • make help lists all targets.
  • One-off defines go through make FLAGS="-DLANG_EN -DFMANAGER_DEBUG"; this replaces PLATFORMIO_BUILD_FLAGS.
  • make BOARD=<name> selects a board. Adding Lilka v3 later means adding a boards/lilka_v3/ folder.

CI

  • The firmware workflow builds in the espressif/idf:v4.4.7 container with ccache.
  • The merged image is created from IDF's flash_args, so it also includes ota_data_initial.bin.
  • Fixed: the version step never exported VERSION_TYPE, so tag builds never produced the per-language images.
  • Fixed: the clang-format target was also checking .c/.cpp files in excluded directories. Lint now covers src/ only.

Also in this PR

  • Home-screen GIF: ~12 → ~19 fps (measured on device). The frame delay now counts from the start of the frame, and the GIF is loaded into PSRAM instead of being read from the SD card during decoding.
  • Lilka v1 removed: v1-only #if branches in the NES OSD and the I2C scanner, legacy/v1_partitions.csv, platformio.ini, targets.py.
  • Docs: README, docs/flashing.rst, AGENTS.md, the debug.h comments and the VS Code extension recommendations now describe the IDF workflow. The PlatformIO screenshots are removed.

Notes for reviewers

  • A local ESP-IDF must be exactly v4.4.7 with its submodules updated (git submodule update --init --recursive). Otherwise it can link Wi-Fi/PHY libraries from another version.
  • sdkconfig lives in the build dir and isn't regenerated from defaults. After changing boards/*/sdkconfig.defaults, run make fullclean.
  • Don't share a build dir between Docker and local builds. Docker uses build-docker/.

@black-ghost-off black-ghost-off added wontfix This will not be worked on wip labels Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wip wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant