[ota] Let the RP2040 stage a gzip image and inflate it at reboot

The Arduino Pico OTA stub already detects a gzip firmware.bin on LittleFS,
reads the inflated length from the trailer and inflates it into the app
region at reboot, so the RP2040 takes the ESP8266 path and no longer needs
the on-the-fly decoder.
This commit is contained in:
J. Nick Koston
2026-09-08 10:11:21 +02:00
parent deb63ea092
commit a0398d120c
2 changed files with 7 additions and 4 deletions
+4 -3
View File
@@ -308,9 +308,10 @@ async def to_code(config: ConfigType) -> None:
if config.get(CONF_ALLOW_PARTITION_ACCESS):
cg.add_define("USE_OTA_PARTITIONS")
# ESP8266 inflates gzip in its bootloader; every other platform inflates
# a deflate stream on the fly while it receives the image
if not CORE.is_esp8266:
# ESP8266 and RP2040 inflate a gzip image at reboot from their bootloader
# or OTA stub; every other platform inflates a deflate stream on the fly
# while it receives the image
if not (CORE.is_esp8266 or CORE.is_rp2):
cg.add_define("USE_OTA_DEFLATE")
# One key per device: an api encryption block supplies it (static or
@@ -15,7 +15,9 @@ class ArduinoRP2OTABackend final {
OTAResponseTypes write(uint8_t *data, size_t len);
OTAResponseTypes end();
void abort();
bool supports_compression() { return false; }
// A gzip image is staged on LittleFS as is; the core's OTA stub inflates it
// into the app region at reboot, the same way the ESP8266 bootloader does
bool supports_compression() { return true; }
private:
bool md5_set_{false};