1. Systems and Tools in Use
This repository maintains two firmware trees at the same time (firmware/port/, based on the ESP32 MicroPython port; esp32s3/firmware/, based on ESP-IDF v5.x + MicroPython v1.24.1) plus the Sphinx documentation, so three parallel dependency declaration mechanisms exist:
ESP-IDF Component Manager (
idf_component.yml): used for the C/C++ component dependencies of esp32s3/firmware, pulled from the official Espressif component registry through theespressif/xxxnamespace.MicroPython frozen manifest (
manifest.py/mpconfigboard.mk): used to compile Python modules into the firmware image (frozen bytecode), controlling the standard library and third-party packages available at runtime.Sphinx documentation dependencies (
docs/requirements.txt): pin the Python package versions required to build the documentation.
In addition, esp32s3/firmware/eim_config.toml uses EIM (Espressif Install Manager) to configure the IDF toolchain, the Python environment, and the PyPI mirror (Tsinghua tuna), enabling accelerated local downloads.
2. Key Files and Locations
Layer |
Key file |
Purpose |
|---|---|---|
S3 firmware top level |
|
Declares the ESP-IDF component dependencies (mdns, tinyusb, esp-sr, esp_audio_codec, esp_video_codec, esp32-camera, joltwallet/littlefs, esp_websocket_client, and more) |
S3 custom component |
|
Display driver component; declares dependencies on |
S3 code generation component |
|
Depends on |
S3 board-level manifest |
|
Reuses the base package set through |
S3 base manifest |
|
Enables MicroPython packages such as |
ESP32 port manifest |
|
Freezes |
Documentation dependencies |
|
Pins the exact versions of 276 packages such as Sphinx, Jupyter, PyQt, and NumPy |
Toolchain configuration |
|
Specifies the IDF path, the toolchain directory, the PyPI mirror ( |
Build script |
|
Requires the |
3. Architecture and Conventions
3.1 Layered Component Sources
Official components: referenced through the
espressif/xxxnamespace, with version numbers expressed as semantic constraints (~1.1.0,^2.0,==1.5.4,>=5.2.0, and so on). Examples:espressif/mdns: ~1.1.0,espressif/esp32-camera: ^2.0.Git branch override:
tinyusbusesgit: https://github.com/micropython/tinyusb-espressif.git+version: cherrypick/dwc2_zlp_fixto temporarily work around upstream issue #3154, illustrating the strategy of “replacing an upstream version with a patched branch”.Local override_path: all GMF (Graphics & Multimedia Framework) related components (
gmf_loader,gmf_app_utils,esp_capture,esp_board_manager,gmf_core,gmf_io,gmf_audio,gmf_ai_audio,gmf_video,gmf_misc,esp_audio_render) point to external Git submodules throughoverride_path: ../../esp-gmf/...and bypass the component registry entirely.Third-party components:
joltwallet/littlefs: ==1.20.4is pinned exactly as the file system backend.
3.2 MicroPython Package Freezing Strategy
The base network stack is pulled in in bulk through
require("bundle-networking").Sensor and communication protocols (
dht,ds18x20,onewire,aioespnow) are declared explicitly throughrequire().Board-level Python modules are compiled into the firmware from the
.pyfiles inesp32s3/firmware/modules/throughfreeze("modules"), forming the modules available at runtime (such asai_cloud.py,ATGM336H_5N.py,neopixel.py,weather.py,xunfei.py, and more).The ESP32 port (
firmware/port/) likewise freezesport/modulesandport/boards/<board>/modulesthroughmanifest.py.
3.3 Documentation Dependency Pinning
esp32s3/docs/requirements.txt is a typical pip freeze artifact. It contains 276 lines of exact versions (such as Sphinx @ file:///..., PyQt==1.9.0, numpy @ file:///...), and many entries use the @ file:/// form pointing at wheels in the CI build cache, which shows that the file is mainly intended for CI reproducibility rather than for local developer installation. In actual development it should be used together with python -m venv and pip install -r requirements.txt.
3.4 Toolchain and Mirrors
eim_config.toml explicitly configures mirrors inside China:
mirror = "https://dl.espressif.cn/github_assets"idf_mirror = "https://jihulab.com/esp-mirror"pypi_mirror = "https://pypi.tuna.tsinghua.edu.cn/simple"
This ensures that the IDF toolchain, the Python packages, and the GitHub Assets are all downloaded from mirrors inside China, improving build speed.
4. Conventions and Constraints
ESP-IDF version pinning:
firmware/port/Makefilehard-codes the supported IDF commit hashes throughESPIDF_SUPHASH_V3/ESPIDF_SUPHASH_V4and validates the git hash of the current IDF at build time; on mismatch it prints a WARNING and continues (not a fatal error).Python version constraint: the ESP32 port requires
pyparsing==2.3.1(<2.4) and exits with an error otherwise; the S3 port specifiespython_version_override = "python313"ineim_config.toml.Submodule management: the README explicitly requires
git clone --recursiveandmake submodules. GMF related components point at the externalesp-gmfsubmodule throughoverride_pathand must be maintained separately.Private/local component isolation: all GMF components point to local paths through
override_path, which keeps them out of the public component registry and makes internal iteration easier.upip is not enabled: the freeze call for
upip.pyinmanifest.pyis commented out, showing that the firmware does not include a remote package manager and that dependencies must be frozen into the image at build time.No vendored third-party source: apart from a few in-house libraries such as
lib/decode_pngandlib/utils, novendor/directory was found; third-party C components are pulled exclusively through the ESP-IDF Component Manager.Documentation and firmware are decoupled:
docs/requirements.txtis only used for the Sphinx build and does not affect firmware compilation; firmware dependencies are concentrated in the two filesidf_component.ymlandmanifest.py.