agentleFS
MingYuan0415MingYuan0415/MicroTech/.agents/skills/esp32/SKILL.md

esp32

Skill1 starsChanged 7 days agoMITView on GitHub

Check MicroTech BSP hardware changes against the supported Waveshare ESP32-S3 Touch AMOLED 1.8 and ESP32-P4-WIFI6-Touch-LCD-3.5 topologies, including pins, strapping, buses, memory, power, radio ownership, and wake capabilities. Use for board facts and physical behavior, not generic ESP32-family advice.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

22 rules. 0 are common, 11 are distinctive, and 11 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read AGENTS.md, doc/verification.md, and layers/bsp/README.md first.

    line 15
  2. Very specific:

    Read the concrete implementation under layers/bsp/waveshare/esp32-s3-touch-amoled-1.8/ or …

    line 16
  3. Distinctive:

    Use the official Waveshare S3 Resources and Documents and P4 Resources and Documents pages as

    line 23
  4. Very specific:

    Read the board's docs/documents.yaml registry before citing a document.

    line 28
  5. Distinctive:

    Check the board schematic for electrical or pin-repurpose work, and the current ESP-IDF capability headers for SoC limits.

    line 34
  6. Very specific:

    Keep ESP-IDF, managed_components/, and layers/bsp/XPowersLib/ read-only.

    line 38
  7. Very specific:

    Read AGENTS.md, layers/bsp/boards.cmake, the existing board manifests and the product manifests.

    line 42
  8. Very specific:

    Create waveshare/<vendor-board>/board.cmake with MT_BOARD_ID, MT_BOARD_TARGET, MT_BOARD_KCONFIG_SYMBOL, MT_BOARD_VENDOR, MT_BOARD_NAME, …

    line 45
  9. Very specific:

    Add the matching docs/documents.yaml and a product manifest under products/.

    line 54
  10. Distinctive:

    Keep pin, bus, address, reset and power-rail facts in the board backend and its README.

    line 58
  11. Distinctive:

    Treat the 368 x 448 SH8601A QSPI panel, FT5x06-compatible touch path, TCA9554 expander, PCF85063 RTC, AXP2101 PMU, QMI8658C IMU, …

    line 72
  12. Distinctive:

    Use the BSP capability and lifecycle APIs.

    line 75
  13. Very specific:

    Never perform an NVS commit or erase (nv_storage_* or nvs_* writes, nvs_erase_*, nvs_commit), an esp_partition_* write or erase, an OTA …

    line 88
  14. Very specific:

    Do not move the LVGL worker stack to internal RAM to make a storage call legal.

    line 97
  15. Distinctive:

    Treat GPIO0, GPIO3, GPIO45, and GPIO46 as ESP32-S3 strapping pins.

    line 104
  16. Distinctive:

    Do not apply the original-ESP32 GPIO12 flash-voltage rule.

    line 108
  17. Distinctive:

    Do not mark GPIO6 through GPIO11 as original-ESP32 flash pins.

    line 110
  18. Very specific:

    Do not treat GPIO34 through GPIO39 as input-only on ESP32-S3.

    line 113
  19. Distinctive:

    Check shared buses, strapping behavior, expander routing, power rails, wake-source capability, and PSRAM/DMA allocation requirements.

    line 127
  20. Distinctive:

    Keep ISRs short and IRAM-safe where required.

    line 131
  21. Distinctive:

    No IMU, no RTC chip, no TCA9554, no TE pin.

    line 168
  22. Very specific:

    Use lvgl-integration for LVGL adapter ownership, draw buffers, flush handshakes, transitions, and display performance.

    line 184

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MicroTech ESP32 Hardware

Apply this skill to the two boards supported by MicroTech. The ESP32-S3 sections below are the original topology; the ESP32-P4 section at the end covers the second variant. Do not transfer pin rules between the boards or from the original ESP32, WROOM, WROVER, or another Waveshare board.

Sources of Truth

  • Read AGENTS.md, doc/verification.md, and layers/bsp/README.md first.
  • Read the concrete implementation under layers/bsp/waveshare/esp32-s3-touch-amoled-1.8/ or layers/bsp/waveshare/esp32-p4-wifi6-touch-lcd-3.5/ before describing pins, buses, reset sequencing, or lifecycle behavior.
  • Read sdkconfig.defaults, sdkconfig.defaults.esp32s3 / sdkconfig.defaults.esp32p4, and the root CMakeLists.txt before describing flash, PSRAM, cache, DMA reserve, or CPU settings.
  • Use the official Waveshare S3 Resources and Documents and P4 Resources and Documents pages as the discovery indexes for each board schematic and the linked Espressif datasheet/TRM and peripheral documents. Select only the document relevant to the subsystem under review and verify its model and revision.
  • Read the board's docs/documents.yaml registry before citing a document. It records the official URL, revision, retrieval date, scope and redistribution state. PDFs are link-only by default; a legally obtained local copy belongs under docs-local/ (ignored by Git) and is a cache, not a new source of authority. If a downloaded file drives a design decision, record its SHA-256 and revision in documents.yaml.
  • Check the board schematic for electrical or pin-repurpose work, and the current ESP-IDF capability headers for SoC limits. Do not depend on machine-specific paths or infer facts from another ESP32 or peripheral variant.
  • Keep ESP-IDF, managed_components/, and layers/bsp/XPowersLib/ read-only.

Adding or Reviewing a Board Variant

  1. Read AGENTS.md, layers/bsp/boards.cmake, the existing board manifests and the product manifests. A board owns only implemented hardware facts; a product owns App composition and runtime policy.
  2. Create waveshare/<vendor-board>/board.cmake with MT_BOARD_ID, MT_BOARD_TARGET, MT_BOARD_KCONFIG_SYMBOL, MT_BOARD_VENDOR, MT_BOARD_NAME, MT_BOARD_DEVICE_PANEL, MT_BOARD_DEVICE_PLATFORM, MT_BOARD_SYSTEM_PM_SUPPORTED, MT_BOARD_HOSTED_RADIO, MT_BOARD_RADIO_SUPPORTED, MT_BOARD_DISPLAY_PROFILE, MT_BOARD_DEFAULT_PRODUCT, MT_BOARD_DOCUMENTS, MT_BOARD_HAL_CAPABILITIES, MT_BOARD_SOURCES and the requires lists. Register it in boards.cmake only when its target is unambiguous; a second board on the same SoC must be selected explicitly with MT_BOARD.
  3. Add the matching docs/documents.yaml and a product manifest under products/; update the shared layers/bsp/docs/README pair only when the registry format changes. The product must not declare a capability that the board backend has not implemented.
  4. Keep pin, bus, address, reset and power-rail facts in the board backend and its README; cite the document registry instead of copying a datasheet.
  5. Validate with python3 tests/run_python_tests.py configuration plus the BSP host suite; record any unexecuted hardware check as a limitation.

Camera support is an example of the rule: the P4 board may physically carry a camera, but no camera BSP capability, HAL operation table, service or App may be claimed until that chain exists. Do not add a capability bit to make an App selectable without the implementation behind it.

Fixed Board Identity

  • Target the Waveshare ESP32-S3 Touch AMOLED 1.8 with 16 MB flash and Octal PSRAM.
  • Treat the 368 x 448 SH8601A QSPI panel, FT5x06-compatible touch path, TCA9554 expander, PCF85063 RTC, AXP2101 PMU, QMI8658C IMU, ES8311/NS4150B audio path, and removable SDSPI storage as the supported board topology.
  • Use the BSP capability and lifecycle APIs. Do not let applications bypass the BSP to own GPIO, bus, power, or peripheral-driver state.

PSRAM Stacks and Flash Access

  • CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM permits PSRAM-backed task stacks. The lvgl worker uses one (stack_in_psram = true in app_manager_lvgl_adapter.c); any task created with MALLOC_CAP_SPIRAM is subject to the same rule.
  • A flash write, erase, or commit disables the flash and PSRAM caches. If the active stack pointer is in PSRAM, ESP-IDF asserts in spi_flash_disable_interrupts_caches_and_other_cpu(); without the assert the stack would be inaccessible while the cache is off.
  • Never perform an NVS commit or erase (nv_storage_* or nvs_* writes, nvs_erase_*, nvs_commit), an esp_partition_* write or erase, an OTA flash operation, or a flash-backed filesystem write from the LVGL worker, an LVGL event/timer/draw callback, or any other PSRAM-stacked task. Queue small storage work on chore_service (internal-RAM worker) or the owning service worker, and keep new storage workers on an internal-RAM stack (the default xTaskCreate* path, or MALLOC_CAP_INTERNAL with the caps APIs).
  • NVS and flash reads through the cache are allowed; the restriction is on operations that disable the cache.
  • Do not move the LVGL worker stack to internal RAM to make a storage call legal. layers/app_manager/app_core/Kconfig and app_manager_lvgl_adapter.c require the LVGL worker stack in PSRAM; move the storage call off the worker instead.

ESP32-S3 Pin Guardrails

  • Treat GPIO0, GPIO3, GPIO45, and GPIO46 as ESP32-S3 strapping pins. Verify their reset-time levels and the board schematic before changing connected circuitry, while recognizing that the board legitimately uses them after boot.
  • Do not apply the original-ESP32 GPIO12 flash-voltage rule. On this board, GPIO12 is the LCD chip-select signal.
  • Do not mark GPIO6 through GPIO11 as original-ESP32 flash pins. The board legitimately uses GPIO4 through GPIO7 for QSPI data and GPIO11 for the LCD clock.
  • Do not treat GPIO34 through GPIO39 as input-only on ESP32-S3. Confirm usable input and output masks in the current ESP-IDF ESP32-S3 soc_caps.h. Capability does not imply board availability: keep GPIO26 through GPIO32 reserved for SPI flash/PSRAM and GPIO33 through GPIO37 reserved by the Octal memory interface unless the exact module and schematic prove otherwise.
  • Preserve the current LCD QSPI mapping from board_display.c: clock GPIO11, chip select GPIO12, data GPIO4/5/6/7, and TE GPIO13. Preserve shared I2C SDA GPIO15, SCL GPIO14, and touch interrupt GPIO21 unless a schematic-backed board revision explicitly changes them.

Hardware Workflow

  1. Identify the owning BSP subsystem and its current pin, bus, and lifecycle definitions.
  2. Check shared buses, strapping behavior, expander routing, power rails, wake-source capability, and PSRAM/DMA allocation requirements.
  3. Compare any electrical or pin change with the board schematic and current ESP32-S3 datasheet or ESP-IDF capability definitions.
  4. Keep ISRs short and IRAM-safe where required. Keep blocking I2C, expander, and peripheral work in task context.
  5. Select tests by actual source and contract impact under doc/verification.md. Driver timing, DMA, power, sleep/wake, radio coexistence, and physical behavior need hardware evidence; report unexecuted checks as limitations, not as implicit authorization or a requirement to flash on every task.

ESP32-P4 Board (second variant)

  • Board: Waveshare ESP32-P4-WIFI6-Touch-LCD-3.5, ESP32-P4NRW32X (in-package 32 MB HEX PSRAM, 16 MB external NOR flash), 2 HP RISC-V cores.
  • The connected chip is ESP32-P4 rev v1.3 (pre-3.0 silicon). Keep CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y, CONFIG_ESP32P4_REV_MIN_100=y and the 360 MHz CPU ceiling. Rev <3.0 and >=3.0 images are mutually exclusive, and a rev >=3.0 image is rejected by this chip at flash time. esp_audio_codec must stay below 2.6 for this revision; main pins the 2.5 line for P4.
  • Display: ST7796 320 x 480 RGB565 over 4-wire SPI: MOSI GPIO20, SCLK GPIO21, CS GPIO23, DC GPIO26, RST GPIO27, backlight GPIO28. No TE. The BSP keeps the panel hidden until the first resume_commit; the panel IO splits strips into 20-row DMA chunks with queue depth 2.
  • Touch: FT6336 (FT5x06 compatible) on I2C SCL GPIO8 / SDA GPIO7 at 400 kHz, RST GPIO29, INT GPIO50.
  • Key input: HOME GPIO35 and POWER GPIO49, both active low. GPIO35 is a boot strapping pin (GPIO35-38); keep its pull-up and do not add a large capacitor.
  • Power: AXP2101 on the shared I2C (address 0x34). Its IRQ is not routed to the P4, so poll the status registers over I2C. Do not reprogram the default power rails; the board's AXP defaults power the SoC. The PWR key also drives the AXP PWRON input.
  • Audio: ES8311 on the shared I2C with MCLK GPIO13, SCLK GPIO12, DOUT GPIO9, LRCK GPIO10 and DIN GPIO11. DOUT carries playback into the codec's DSDIN and DIN carries the codec's ASDOUT capture; do not swap them. NS4150B PA enable is GPIO53 (active high, held off until bsp_audio_start()). The capture PGA runs at 36 dB.
  • Storage: microSD on SDMMC slot 0, 4-bit, CLK GPIO43, CMD GPIO44, D0-D3 GPIO39-42. The slot's IO rail is supplied by the on-chip LDO4, which the BSP acquires before mounting. There is no card-detect pin; mounting is explicit and formatting is never automatic.
  • No IMU, no RTC chip, no TCA9554, no TE pin. The BSP does not register RTC or IMU capabilities.
  • C6 coprocessor: SDIO CLK GPIO18, CMD GPIO19, D0-D3 GPIO14-17, reset GPIO54, C6_IO2 strap GPIO6. The hosted stack owns these pins and the C6 reset; the BSP must not drive them. C6 UART and IO9 are on header J6 (23/25/27, GND 29).
  • Power management: RTCIO is GPIO0-15; both keys are outside it and the P4 has no GPIO light-sleep wake source. CPU light sleep cannot be woken by the keys, so board_get_wakeup_descriptor() is empty and app_runtime skips system_pm_init. Only the app-manager screen-off path is available.
  • The P4 radio is hosted: CONFIG_ESP_HOSTED_HOST_FEAT_WIFI and ..._FEAT_BT route esp_wifi_* and NimBLE HCI to the C6. Do not add native CONFIG_ESP_WIFI_*/BT_CTRL_* controller settings or CONFIG_ESP_HOST_WIFI_ENABLED.

Display Boundary

Use lvgl-integration for LVGL adapter ownership, draw buffers, flush handshakes, transitions, and display performance. Use this skill for the BSP panel bus, GPIO, touch, power sequencing, and hardware constraints beneath that pipeline.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.