# Architecture Design The repository is vertically partitioned around the ESP32-S3 product line and contains two top-level directories, `esp32s3/firmware/` and `esp32s3/docs/`: - `esp32s3/firmware/` independently maintains the firmware source code based on ESP-IDF v5.x + MicroPython v1.24.1 + CMake; the top-level `CMakeLists.txt` selects `boards//mpconfigboard.cmake` via the `MICROPY_BOARD` variable and merges multiple `sdkconfig.*` fragments to generate the final configuration; the firmware is split into layers such as builtins (C-layer built-in modules), modules (Python-layer runtime modules), components (IDF components such as `esp_lcd_jd9853` and `gen_bmgr_codes`), drivers (such as `mpu6050` IMU fusion), and file_system (LVGL UI and business scripts organized by board); adding a new board only requires copying the board directory and modifying `mpconfigboard.h`, `mpconfigboard.cmake`, `partitions-*.csv`, and `manifest.py`. - `esp32s3/docs/` adopts the Sphinx RST documentation system; the top-level `index.rst` organizes `1_hardware` (hardware specifications), `2_software` (environment setup), `3_examples` (examples categorized by basics/advance/classic/Agent/AudioAI), `4_xiaozhi` (Xiaozhi AI Assistant topic), `5_api` (four-level API reference: library/mPython/micropython/pythonStd/mpy_ref), `6_C_program` (Arduino/PlatformIO/ESP-IDF development guide), and `7_faq` through the toctree; `boards/ledong_v2/` contains a mirror documentation tree for the mPython Core 2.0 board, each with its own `conf.py`/`Makefile` for separate builds. - Adds ESP32-S3-specific components such as LVGL GUI, AI cloud, GPS, heart rate, BLE CodexPad, and iFlytek IAT speech dictation, and integrates the Xiaozhi AI Assistant (`docs/4_xiaozhi/`). - Board differences are uniformly declared via `mpconfigboard.h`, `mpconfigboard.cmake`, `sdkconfig.board`, and `manifest.py` under `esp32s3/firmware/boards//`, avoiding modification of the core firmware code; cross-board compatibility relies on "a single set of mPython API conventions" and the "board manifest mechanism".