This document provides setup instructions for using ESP Serial Flasher on different host platforms to program and interact with ESP devices.
Each port is a reference implementation tied to a specific platform SDK. The tested SDK versions are noted in each platform section below. Ports are not part of the library's semantic versioning guarantee. Ports are maintained on a best-effort basis — breaking changes to them are minimized, but are sometimes necessary to stay up to date with upstream platform SDKs. When such an update is needed, it is released as a minor or patch version of this library.
Before setting up any platform, ensure you have the following:
- CMake 3.22 or later - Build system generator
- Platform-specific toolchain - See individual platform sections below
Testing Status: Regularly tested with all major and minor versions of ESP-IDF from v5.5 onwards
- ESP-IDF v5.5+ - ESP-IDF development framework
ESP Serial Flasher is available as a managed component through the Espressif Component Registry. This is the recommended installation method for ESP-IDF projects.
Installation:
- Navigate to your ESP-IDF project directory
- Add the component dependency:
idf.py add-dependency "espressif/esp-serial-flasher" - Build your project:
idf.py build
The component will be automatically downloaded and integrated into your project's build system.
Component Registry: espressif/esp-serial-flasher
See examples/esp32_example for a complete implementation with build instructions.
No pre-built example project is provided for STM32, as STM32 projects are chip-specific and generated by STM32CubeMX. The examples/stm32_example directory contains a guide that walks through generating a project for your MCU, integrating esp-serial-flasher, and writing the application code.
Testing Status: Regularly tested with Zephyr RTOS v4.0.0 and Zephyr SDK v0.17.0.
- Zephyr RTOS - Real-time operating system
- Zephyr SDK - Development toolkit
- West - Zephyr's meta-tool for managing repositories
ESP Serial Flasher can be integrated as a Zephyr module. Add the following to your West manifest file (west.yml):
manifest:
projects:
- name: esp-flasher
url: https://github.com/espressif/esp-serial-flasher
revision: master
path: modules/lib/esp_flasherAfter updating the manifest, fetch the module:
west updateAdd these configuration options to your prj.conf:
CONFIG_ESP_SERIAL_FLASHER=y
CONFIG_CONSOLE_GETCHAR=y
See examples/zephyr_example for a complete implementation with build instructions.
Testing Status: Regularly tested with Raspberry Pi Pico SDK v1.5.1 and arm-gnu-toolchain-13.2.
- Git - For cloning repositories
- Raspberry Pi Pico SDK - Development framework
- ARM GCC toolchain - Cross-compilation toolchain
-
Clone the repository:
git clone https://github.com/espressif/esp-serial-flasher.git cd esp-serial-flasher -
Ensure Pico SDK is available:
- Either set
PICO_SDK_PATHenvironment variable - Or place the Pico SDK in a standard location
- Either set
See examples/pi_pico_example for a complete implementation with build instructions.
Testing Status: Regularly tested on Debian/Ubuntu. Also runs on SBCs such as Raspberry Pi 4/5 running Raspberry Pi OS or any other Linux distribution.
- CMake ≥ 3.22 and a C compiler (gcc / clang)
- libgpiod ≥ 2.0 — only required when using GPIO character-device mode for reset/boot control on SBCs (not needed for USB connections)
Install libgpiod on Debian/Ubuntu:
# Debian 13 (Trixie) / Ubuntu 24.04 or later — libgpiod 2.x is in the main repos:
sudo apt-get install libgpiod-dev
# Older distros: build from source (https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git)Ensure your user is in the dialout (and optionally gpio) groups:
sudo usermod -aG dialout $USER # for serial port access
sudo usermod -aG gpio $USER # for GPIO character-device access (SBCs)
# logout and back in for group changes to take effectcd examples/linux_example
mkdir -p build && cd build
# USB connection (DTR/RTS auto-reset — no GPIO library needed):
cmake ..
# GPIO connection (SBC with libgpiod reset/boot control):
cmake -DLINUX_PORT_GPIO=ON ..
make| Variable | Default | Description |
|---|---|---|
PORT |
— | Must be LINUX |
LINUX_PORT_GPIO |
OFF |
Enable GPIO character-device support (requires libgpiod ≥ 2.0) |
See examples/linux_example for a complete implementation including run-time options, wiring diagrams, and Raspberry Pi-specific setup steps.
After successful platform setup:
- Review the Configuration Guide for library configuration options
- Check platform-specific examples in the
examples/directory - Read the API documentation for usage details
- Upgrading from v1? See the Migration Guide