esp-serial-flasher-skill

Generate host firmware code that flashes Espressif SoCs over UART, USB, SPI, or SDIO.

28|3|Updated Jun 24, 2026
One-click install
npx skills add https://github.com/JasonYANG170/esp-dev-skill --skill esp-serial-flasher-skill-jasonyang170
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: esp-serial-flasher-skill
Source: https://github.com/JasonYANG170/esp-dev-skill/tree/main/repos/esp-serial-flasher
Command: npx skills add https://github.com/JasonYANG170/esp-dev-skill --skill esp-serial-flasher-skill-jasonyang170

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing host-side firmware that programs an ESP target chip from another MCU, SBC, or PC is error-prone: the v2 API requires a specific init/connect/flash state machine, per-chip bootloader addresses, ESP8266 special cases, and interface-specific restrictions. This Skill grounds every generated line in the real esp-serial-flasher repository so the AI produces correct, compilable flashing code instead of hallucinated APIs. ## Core Features & Use Cases - Scenario Recipes: 14+ recipes covering UART connect and multi-partition flashing, flasher stub connections, MD5-verified fast reflash, deflate-compressed flashing, RAM download, flash erase/read, and target info retrieval. - Host Platform Integration: Dedicated guides for ESP-IDF managed component setup, STM32 (CubeMX pre-initialized peripherals), Zephyr (devicetree-driven port), Raspberry Pi Pico, Linux (DTR/RTS or libgpiod), and fully custom ports via the vtable interface. - API, Config & Pitfall References: Complete v2 API signatures, Kconfig/CMake options, support matrices, and 14 critical wrong-vs-right pitfalls to validate generated code. - Use Case: Ask the AI to build an STM32-based production flasher that programs an ESP32-C6 over UART with MD5 verification; the Skill supplies the correct port struct, init sequence, flash state machine, and build integration. ## Quick Start Ask the AI to write host firmware that connects to an ESP32 target over UART and flashes the bootloader, partition table, and application with MD5 verification.

Frequently Asked Questions about esp-serial-flasher-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I flash an ESP32 from another microcontroller?

Use the ESP Serial Flasher library: declare a platform port struct with an ops vtable, call esp_loader_init_serial with an esp_loader_t context, connect with esp_loader_connect, then run flash_start, flash_write, and flash_finish per partition. The Skill provides complete recipes for each host platform.

What is the difference between esp_loader_connect and esp_loader_connect_with_stub?

esp_loader_connect uses the ROM bootloader, while connect_with_stub uploads the flasher stub to unlock higher baud rates, deflate-compressed writes, fast flash reads, and flash larger than 2MB. The stub adds about 87KB of rodata to host flash and only works on serial interfaces.

Which host platforms does ESP Serial Flasher support?

Built-in ports cover ESP-IDF v5.5+, STM32 HAL, Zephyr v4.4.0, Raspberry Pi Pico SDK v2.2.0, and Linux with optional libgpiod. Any other C99 platform with CMake 3.22+ can be supported by implementing a custom port vtable with PORT set to USER_DEFINED.

Why does flashing an ESP8266 target fail with MD5 or baud rate errors?

ESP8266 does not support changing the transmission rate and lacks MD5 verification without the stub. Set skip_verify to true in the flash config and skip esp_loader_change_transmission_rate when the detected target is ESP8266_CHIP.

Can the SPI interface flash firmware to an ESP target?

No, the SPI interface only supports RAM download; calling flash APIs after esp_loader_init_spi returns ESP_LOADER_ERROR_UNSUPPORTED_FUNC. Use UART, USB CDC-ACM, or SDIO for actual flash writing.

When should I not use ESP Serial Flasher?

Do not use it for PC-based flashing with Python esptool, for developing application firmware that runs on the target chip itself, for non-Espressif targets, or for SPI flash filesystem operations. It only handles host-to-target bare flash programming.