Files
led-controller/scripts/c6-ota/mcu_host
jimmyandClaude Opus 5.5 ba8e160aee scripts: P4-Nano probe app and C6 esp-hosted OTA tools
p4-probe identifies the P4 and its C6 over esp-hosted SDIO. c6-ota holds the
C6 coprocessor build and the two host updaters (3.1 and the 2.x one that moved
the factory C6 firmware to esp-hosted 3.1). Also the pending graphify output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 13:52:12 +13:00
..

ota / coprocessor_ota — Host

Pushes a new CP firmware image from the host through the OTA begin / write / end / activate RPC chain. The host can source the image from one of three places — HTTPS, an on-host LittleFS partition, or a dedicated raw flash partition — selected at build time.

Supported Platforms and Transports

Supported Coprocessors

Coprocessor ESP32 ESP32-C Series ESP32-S2/S3 ESP32-S31
Support Yes Yes Yes Yes ¹

¹ ESP32-S31: preview target, 2.4 GHz only, no SDIO. See ESP32-S31 test board.

Supported Host Devices

Host Device ESP32-P4 ESP32-H2 Other MCUs Linux
Support Yes Yes Yes Yes

Supported Connection buses

Connection bus SDIO SPI Full-Duplex SPI Half-Duplex UART
Linux host Yes Yes No No
MCU host Yes Yes Yes Yes

Scenario

The host streams new co-processor firmware over the control path using the four-call OTA RPC chain — begin → write (looped) → end → activate. (activate is a distinct RPC, needed on CP firmware v2.6.0+.) API names below are the example's compat surface (esp_hosted_slave_ota_*); the native equivalents are eh_host_cp_ota_*.

sequenceDiagram
    participant App as Host app
    participant CP as Co-processor
    participant SRC as Firmware source (HTTPS / LittleFS / partition)
    App->>CP: esp_hosted_slave_ota_begin() (RPC)
    loop firmware chunks
        App->>SRC: fetch chunk
        App->>CP: esp_hosted_slave_ota_write(chunk) (RPC)
    end
    App->>CP: esp_hosted_slave_ota_end() (RPC)
    App->>CP: esp_hosted_slave_ota_activate() (RPC)
    CP->>CP: set boot partition
    CP-->>App: result
    Note over CP: reboot into new firmware

Select the transport (must match the co-processor) and pick the OTA method:

cd examples/ota/coprocessor_ota/mcu_host
idf.py set-target esp32p4
idf.py menuconfig
Component config
└── ESP-Hosted
     └── Configure host
          └── Host transport
               ├── Communication bus (co-processor <== bus ==> host)
               │    ├── ( ) SPI Full Duplex
               │    ├── (X) SDIO                    <── default (match the co-processor)
               │    ├── ( ) SPI Half Duplex
               │    └── ( ) UART
               └── SDIO Configuration               ← slot, bus width, GPIOs (defaults OK)
ESP-Hosted Coprocessor OTA Config
├── Select OTA Method
│     ├── (X) HTTP OTA                                   <── default
│     ├── ( ) LittleFS OTA
│     └── ( ) Partition OTA
│
├── WiFi Connection                                       ⎫
│     ├── (MyWiFiSSID) WiFi SSID                          │
│     └── (········)   WiFi Password                      │
├── HTTPS OTA Configuration                               ⎬  HTTP OTA method
│     ├── (…/firmware.bin) OTA Server URL                 │
│     ├── (30000) HTTPS connection timeout (ms)           │
│     └── [ ] Use self-signed certificate (testing only)  ⎭
│
├── (slave_fw) Partition Label                            ←  Partition OTA method
├── [*] Delete OTA file after flashing                    ←  LittleFS OTA method
│
└── OTA Verification Options
      ├── [*] Host-Slave version compatibility check
      └── [*] Skip OTA if slave firmware versions match

Host dependency config is pre-set in mcu_host/sdkconfig.defaults (do not remove):

CONFIG_ESP_HOSTED_HOST_FEAT_WIFI=y   # Wi-Fi — HTTPS OTA download path

Then flash and monitor:

idf.py -p <host_usb_serial_port> flash monitor