Files
led-controller/scripts/c6-ota/cp/README.md
T
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

3.6 KiB

ota / coprocessor_ota — Coprocessor

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

OTA runs on the co-processor's System feature (OTA / heartbeat / FW version), pre-enabled in cp/sdkconfig.defaults — you only select the transport:

cd examples/ota/coprocessor_ota/cp
idf.py set-target esp32c6
idf.py menuconfig
Component config
└── ESP-Hosted
     └── Configure coprocessor
          └── CP transport
               ├── Communication bus (co-processor <== bus ==> host)
               │    ├── ( ) SPI Full Duplex
               │    ├── (X) SDIO                    <── default
               │    ├── ( ) SPI Half Duplex         ← MCU host only
               │    └── ( ) UART                    ← MCU host only
               └── SDIO Configuration               ← clock, GPIOs, checksum (defaults OK)

Each bus has its own settings submenu (pins, clock, checksum) — defaults are fine for bring-up.

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

CONFIG_ESP_HOSTED_CP_FEAT_WIFI=y     # Wi-Fi — HTTPS OTA download path
CONFIG_BT_ENABLED=n

The System feature (OTA, heartbeat, FW version) is always enabled on the co-processor, so it needs no config.

Then flash and monitor:

idf.py -p <cp_usb_serial_port> flash monitor