ESP32 memory, filesystem, serial, and SD card providers
Repository: github.com/dekiengine/deki-esp32-integration · Latest release: 0.40.0 · Needs engine 0.40.0+ · Requires: deki-wifi, deki-ble, deki-http, deki-i2s, deki-uart, deki-i2c, deki-gpio, deki-sdcard, deki-rendering
Install with DekiEditor --packages-add deki-esp32-integration <project>, or from the Package Manager. The engine's own components and C++ API are in the Deki docs.
Shown in the editor as ESP32 Integration.
Components
| Component | Category | Description |
| ESP32QemuDisplaySetup | ESP32 HAL | Opens the screen of Espressif's QEMU, for running a firmware build without a board. |
| ESP32SerialSetup | ESP32 HAL | Answers the editor's commands over the ESP32's serial port. |
Feature flags
Parts you can leave out of a build. A feature with a define is switched there; the rest are stripped with their components.
| Feature | Define | Default |
| Memory | DEKI_FEATURE_ESP32_MEMORY_SETUP | on |
| File System | DEKI_FEATURE_ESP32_FILE_SYSTEM_SETUP | on |
| Serial Commands | DEKI_FEATURE_ESP32_SERIAL_SETUP | on |
| SD Card (ESP-IDF) | DEKI_FEATURE_ESP32_SD | on |
| GPIO (ESP-IDF) | DEKI_FEATURE_ESP32_GPIO | on |
| I²C (ESP-IDF) | DEKI_FEATURE_ESP32_I2C | on |
| SPI (ESP-IDF) | DEKI_FEATURE_ESP32_SPI | on |
| Display present worker and parallel bus (ESP-IDF) | DEKI_FEATURE_ESP32_DISPLAY_WORKER | on |
| UART (ESP-IDF) | DEKI_FEATURE_ESP32_UART | on |
| I²S (ESP-IDF) | DEKI_FEATURE_ESP32_I2S | on |
| S3 SIMD Blit Kernels | DEKI_FEATURE_ESP32_BLIT_SIMD | on |
| WiFi STA + scan (ESP-IDF) | DEKI_FEATURE_ESP32_WIFI | on |
| BLE (NimBLE) | DEKI_FEATURE_ESP32_BLE | on |
| QEMU Display | DEKI_FEATURE_ESP32_QEMU_DISPLAY | on |
| HTTPS client (ESP-IDF) | DEKI_FEATURE_ESP32_HTTP | on |
Component reference
ESP32QemuDisplaySetup
Opens the screen of Espressif's QEMU, for running a firmware build without a board.
Inspector name: ESP32 Qemu Display Setup · Category: ESP32 HAL · Type: DekiEsp32::ESP32QemuDisplaySetup
| Property | Type | Default | Constraints | Description |
| width | int32 | 320 | 1 to 4096 | The screen's width in pixels. |
| height | int32 | 240 | 1 to 4096 | The screen's height in pixels. |
| format | enum | "RGB565" | RGB565, ARGB8888 | The screen's pixel format. The game renders in it. |
ESP32SerialSetup
Answers the editor's commands over the ESP32's serial port.
Inspector name: ESP32 Serial Setup · Category: ESP32 HAL · Type: DekiEsp32::ESP32SerialSetup
| Property | Type | Default | Constraints | Description |
| baudRate | int32 | 115200 | 9600 to 921600 | Serial baud rate |
Changelog
0.40.0
Added
- DEKI:PROFILE also reports each object in the scene, most expensive first: a DEKI:PROFILE:OBJECT line with its path, type, sorting order, its share of finding what changed, of making and drawing its pixels, how many times it was drawn and why (new, changed, still, overPin), per frame; the first 64, then DEKI:PROFILE:OBJECTS with how many there were.
Changed
- minEngine 0.40.0: built against engine 0.40.0. A build of this package from before does not load and is rebuilt.
- Builds keep the WiFi driver's code in flash (CONFIG_ESP_WIFI_IRAM_OPT=n, CONFIG_ESP_WIFI_RX_IRAM_OPT=n): 18.5 KB more internal RAM for the game, the display and the radio's own buffers, whether WiFi is on or not. Measured on a T-Deck Plus: 1 MB downloads over a phone hotspot averaged 140 KB/s against 149 KB/s (the ranges overlap), and frames cost the same while WiFi was busy. A board that wants the driver's code in internal RAM again sets both to y in its platform's sdkconfig list, which comes last. Existing projects get it on their next build: the builder regenerates a stale sdkconfig when its defaults change.
- Builds also keep the radio's PHY code and libc's locks in flash (CONFIG_ESP_PHY_IRAM_OPT=n, CONFIG_LIBC_LOCKS_PLACE_IN_IRAM=n): 1 KB more internal RAM. Frames on a T-Deck Plus cost the same (19.7 ms against 19.6 on a farm map, 32.9 against 32.9 with 16 sprites walking). The heap's functions stay in internal RAM: in flash they cost about 5.5 ms a frame.
- ESP32-S3 builds have a 32 KB instruction cache (CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y; ESP-IDF's default is 16 KB). A frame runs more code than 16 KB holds, and how often it missed depended on where a build placed the code: the same scene moved by a millisecond between unrelated builds. Measured on a T-Deck Plus with a scrolling farm: 19.0 to 16.9 ms a frame, 21.9 to 18.5 ms with 4 sprites walking, 30.6 to 26.0 ms with 16, and builds within 0.2 ms of each other. It takes 16 KB of internal RAM; a board that needs it back sets CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y in its sdkconfig list.
- Boards with PSRAM keep the static data ESP-IDF's libraries allow there in PSRAM (CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y): 14.4 KB of WiFi, lwIP and network tables in a T-Deck build, which only WiFi touches.
- Allocations through operator new, std::vector and std::string go to PSRAM once DMA-capable internal RAM, not all internal RAM, is down to 16 KB. An ESP32-S3's RTC fast memory (about 8 KB) is internal but no driver's DMA reaches it, so the old count let a scene's objects leave drivers almost nothing. With these three changes, a T-Deck Plus running the farm in whole frames keeps 14.9 KB of DMA-capable RAM free (largest block 13.8 KB), room for an SD card and audio started mid-game.
Fixed
- Choosing ESP-IDF in the New Platform dialog no longer crashes the panel: the package now takes the editor's ImGui context.
0.30.0
Changed
- minEngine 0.30.0: built against engine 0.30.0. A build of this package from before does not load and is rebuilt.
Fixed
- A firmware build from the editor runs ESP-IDF. On a machine whose PATH holds an entry with a stray quote (a Windows Kits installer leaves one), the build ran nothing and reported success: the variables it sets were set lines in one cmd line, and the quote, expanded from PATH%, closed one early and turned the rest of the line, export.bat and idf.py included, into a value. They are the build's environment now, not part of its command, and such an entry's quote is left out of the build's PATH, which the build says, naming the entry (otherwise cmd finds nothing after it, and export.bat reports git missing).
- A build is a success only when it leaves the firmware (build/DekiGame.bin): one that exits 0 without it fails, saying so. A build with nothing to rebuild says the firmware was already up to date. The build output names the firmware file.
- ESP-IDF runs with PYTHONUTF8=1, as idf.py asks for on a console that is not UTF-8.
Earlier releases: CHANGELOG.md.
Generated from the package's reflection data (engine 0.40.1). Property names are the keys used in scene files. Renames keep an alias (compatibility).