Skip to content

Add ESP32-S3 board support and build-runtime command - #136

Open
ciniml wants to merge 2 commits into
csg-tokyo:mainfrom
ciniml:feature/esp32s3-restructured
Open

Add ESP32-S3 board support and build-runtime command#136
ciniml wants to merge 2 commits into
csg-tokyo:mainfrom
ciniml:feature/esp32s3-restructured

Conversation

@ciniml

@ciniml ciniml commented Aug 28, 2026

Copy link
Copy Markdown

Summary

  • Add ESP32-S3 as a supported board that shares the ESP-IDF installation with ESP32. The ESP32 toolchain is parameterized by chip target (esp32, esp32s3) so each variant builds in its own directory with its own sdkconfig.
  • Add bscript board build-runtime command to build the runtime without flashing, useful when the board is connected to a different host.
  • Enable BLE 4.2 advertising API and guard Classic BT memory release for non-ESP32 targets. Disable memory protection (CONFIG_ESP_SYSTEM_MEMPROT_FEATURE) so executable RAM can be allocated on ESP32-S3.

Changes

Commit 1: Add ESP32-S3 board support (25 files)

  • Parameterize ESP32 toolchain by Esp32Target (toolchain names, build directory, ROM linker scripts)
  • Add esp32s3 board config, project schema, and board-env
  • Share ESP-IDF clone between esp32 and esp32s3 setups
  • Add sdkconfig.defaults with BLE 4.2, partition table, and memprot disabled
  • Add NULL check in bs_memory_init() with clear error message
  • Guard esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT) with #if CONFIG_IDF_TARGET_ESP32
  • Unit tests for setup, remove, and flash-runtime with esp32s3
  • Documentation updates

Commit 2: Add board build-runtime command (5 files)

  • New build-runtime.ts command handler
  • Add abstract buildRuntime() and build() to FlashRuntimeHandler
  • Register the command in the CLI entry point
  • Unit tests and documentation

Test plan

  • npx jest cli/tests/commands/board/esp32s3.test.ts — all 8 tests pass (setup, remove, flash-runtime, build-runtime)
  • bscript board setup esp32s3 on a clean environment
  • bscript board build-runtime esp32s3 builds successfully
  • bscript board flash-runtime esp32s3 flashes and runs on an ESP32-S3 board
  • Existing esp32 workflows are unaffected

🤖 Generated with Claude Code

https://claude.ai/code/session_0168VKgxvuFTSxND1Wn9CdaG

ciniml and others added 2 commits August 28, 2026 18:06
Add esp32s3 as a supported board that shares the ESP-IDF installation
with esp32. The ESP32 toolchain is parameterized by chip target so each
variant builds in its own directory with its own sdkconfig.

Key changes:
- Parameterize the ESP32 toolchain by Esp32Target (toolchain names,
  build directory, ROM linker scripts)
- Build the runtime for esp32s3 in ports/esp32/build-esp32s3 with
  sdkconfig.esp32s3 generated from sdkconfig.defaults
- Enable BLE 4.2 advertising API and skip Classic BT memory release
  on non-ESP32 targets
- Disable memory protection (CONFIG_ESP_SYSTEM_MEMPROT_FEATURE) so
  executable RAM can be allocated on ESP32-S3
- Add NULL check in bs_memory_init() with a clear error message
- Share the ESP-IDF clone between esp32 and esp32s3 setups
- Add unit tests for setup, remove, and flash-runtime with esp32s3

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U2xPxvDJAipDisXeFvWoAh
Add 'bscript board build-runtime <board>' to build the runtime without
flashing it. This is useful when the board is connected to a different
host: build on the development machine, copy the build directory, and
flash with esptool.py on the target host.

- Add build-runtime.ts with the new command handler
- Add abstract buildRuntime() and build() to FlashRuntimeHandler
- Export FlashRuntimeHandler, ESP32FlashRuntimeHandler, and
  getFlashRuntimeHandler so the new command can use them
- Register the command in the CLI entry point
- Add unit tests and documentation

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U2xPxvDJAipDisXeFvWoAh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant