ESP32 Hosted Co-processor Update

This platform allows you to update the firmware of an ESP32 co-processor connected via the ESP32 Hosted component. The firmware binary is embedded into your device’s flash at compile time and can be deployed to the co-processor on demand.

The component automatically detects the current co-processor firmware version and compares it to the version embedded in your device. If the versions differ, an update becomes available in Home Assistant or through the ESPHome API.

# Example configuration entry
# Note: Host device must be ESP32-H2 or ESP32-P4
esp32_hosted:
  variant: ESP32C6  # Co-processor variant
  reset_pin: GPIOXX
  cmd_pin: GPIOXX
  clk_pin: GPIOXX
  d0_pin: GPIOXX
  d1_pin: GPIOXX
  d2_pin: GPIOXX
  d3_pin: GPIOXX
  active_high: true

update:
  - platform: esp32_hosted
    path: coprocessor-firmware.bin
    sha256: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef

Configuration variables

  • path (Required, string): Path to the co-processor firmware binary file (.bin). The path is relative to your ESPHome configuration file.

  • sha256 (Required, string): SHA256 hash of the firmware binary file. This is used to verify the integrity of the firmware both at compile time and at runtime before flashing to the co-processor.

  • All other options from Update.

Platform requirements

This update platform requires:

  • Host device (running ESPHome): ESP32-H2 or ESP32-P4
  • Co-processor (being updated): Any ESP32 variant supported by ESP-Hosted (e.g., ESP32-C6 as shown in the example)

The host device must have sufficient flash space to store the co-processor firmware binary.

Obtaining co-processor firmware

To build firmware for your ESP32 co-processor, refer to the ESP IDF Get Started. The firmware should be built using the ESP-IDF framework and the resulting .bin file should be placed in your ESPHome configuration directory.

# Build instructions for IDF 5.5.1 and ESP Hosted 2.6.1
git clone -b v5.5.1 --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
./install.sh esp32c6
source export.sh  # for Linux/macOS
export.bat        # for Windows
cd ..
idf.py create-project-from-example "espressif/esp_hosted^2.6.1:slave"
cd slave/
idf.py set-target esp32c6
idf.py build

After building the firmware, copy it to your ESPHome configuration directory and generate its SHA256 hash:

# Copy the firmware to your ESPHome config directory
cp build/network_adapter.bin /path/to/your/esphome/config/coprocessor-firmware.bin

# Generate SHA256 hash (Linux/macOS)
sha256sum /path/to/your/esphome/config/coprocessor-firmware.bin

# Generate SHA256 hash (Windows PowerShell)
Get-FileHash -Algorithm SHA256 coprocessor-firmware.bin

# Generate SHA256 hash (Windows Command Prompt with certutil)
certutil -hashfile coprocessor-firmware.bin SHA256

Use the generated hash in your sha256 configuration parameter.

See Also