Skip to content

Add LILYGO T-Deck Pro (ESP32-S3FN16R8) build and OpenOCD flash support#94

Merged
JohnAmadis merged 2 commits into
masterfrom
copilot/prepare-project-for-t-deck-pro
May 11, 2026
Merged

Add LILYGO T-Deck Pro (ESP32-S3FN16R8) build and OpenOCD flash support#94
JohnAmadis merged 2 commits into
masterfrom
copilot/prepare-project-for-t-deck-pro

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

The project only supported ARM STM32 targets. This adds full build and OpenOCD flash support for the LILYGO T-Deck Pro — ESP32-S3FN16R8 (Xtensa LX7 dual-core, 240 MHz, 16 MB flash, 8 MB PSRAM) with built-in USB JTAG.

New architecture: xtensa/lx7

  • configs/arch/xtensa/arch.ldelf32-xtensa-le output format
  • configs/arch/xtensa/cfg.cmake — sets DMBOOT_OBJCOPY_OUTPUT_FORMAT / DMBOOT_OBJCOPY_BINARY_ARCH for Xtensa
  • configs/arch/xtensa/lx7/tools-cfg.cmakelocal toolchain override (checked before dmod submodule); configures xtensa-esp32s3-elf-*, enables -mabi=call0 -mlongcalls

New MCU: ESP32S3 / esp32s3fn16r8

  • configs/mcu/ESP32S3.cmake — 240 MHz, OpenOCD via esp_usb_jtag.cfg + esp32s3.cfg
  • configs/mcu/esp32s3/esp32s3fn16r8/mcu.ld — code in IRAM (0x40374000, 320 KB), data in DRAM (0x3FC88000, 416 KB); no ROM-bootloader cache setup required for direct JTAG load

New board: t-deck-pro

  • configs/board/t-deck-pro/board.cmake — sets TARGET=ESP32S3

Startup code: Xtensa LX7

  • src/arch/xtensa/lx7/startup.S — reset handler in call0 ABI: disables interrupts (rsil), initialises .data/.bss, calls low_level_init_0/1 then main()
  • src/arch/xtensa/dmod_critical.c — nested critical sections via rsil/wsr PS

Build system changes

  • configs/arch/armv7/cfg.cmake — now explicitly sets DMBOOT_OBJCOPY_OUTPUT_FORMAT=elf32-littlearm (previously implicit)
  • scripts/embed_binary.cmake, scripts/romfs.cmake, CMakeLists.txt — replace hard-coded elf32-littlearm/arm objcopy args with the arch-aware variables
  • CMakeLists.txt — checks for a local configs/arch/<arch>/<family>/tools-cfg.cmake before falling back to the dmod submodule, enabling the Xtensa toolchain to be configured without touching the submodule

Usage

cmake -DBOARD=t-deck-pro -S . -B build
cmake --build build

# Flash via built-in USB JTAG (requires Espressif OpenOCD fork)
cmake --build build --target install-firmware

Copilot AI linked an issue May 11, 2026 that may be closed by this pull request
…config, startup code, and OpenOCD flashing

Agent-Logs-Url: https://github.com/choco-technologies/dmod-boot/sessions/83abb048-9e6c-4d91-977c-0232a918ca28

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot AI changed the title [WIP] Prepare project for T-Deck Pro firmware build Add LILYGO T-Deck Pro (ESP32-S3FN16R8) build and OpenOCD flash support May 11, 2026
Copilot AI requested a review from JohnAmadis May 11, 2026 11:09
@JohnAmadis JohnAmadis marked this pull request as ready for review May 11, 2026 11:16
@JohnAmadis JohnAmadis merged commit cc35bf6 into master May 11, 2026
4 of 5 checks passed
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.

Przygotować projekt pod T-Deck Pro

2 participants