Von English mit KI übersetzt ·
Wir haben genau das bei Gebäudesteuerungen gemacht (STM32 plus ein ESP32-Modem). Hermetry ist es egal, welcher Chip das Image am Ende ausführt; es spricht nur mit dem angemeldeten Gerät, deshalb lädt und meldet der ESP32.Wenn Sie ein Paket zuweisen, erhält das Gerät in einer Nachricht auf v1/attributes/set diese gemeinsamen Attribute: fw_title, fw_version, fw_size, fw_checksum, fw_checksum_algorithm (SHA256), fw_url und fw_sig, falls das Paket eine separate Signatur hat. fw_url ist eine kurzlebige HTTPS-Adresse mit 15 Minuten Gültigkeit, und der Download kann mit einer HTTP-Range-Anfrage fortgesetzt werden.Das Gerät meldet den Fortschritt als Client-Attribute: fw_state durchläuft DOWNLOADING, DOWNLOADED, VERIFIED, UPDATING, UPDATED (oder FAILED mit fw_error), fw_progress 0 bis 100 während des Downloads, und nach dem Neustart current_fw_title und current_fw_version. UPDATED allein wird nicht akzeptiert, es wird die neue laufende Version erwartet.Unser Ablauf auf dem ESP32:
1. fw_* kommt an -> prüfen fw_title == "irr-stm32"
2. GET fw_url (Range-Fortsetzung) in den ESP32-Flash, fw_progress melden
3. SHA-256 + Ed25519-Prüfung gegen fw_sig -> fw_state VERIFIED
4. Image per UART in den STM32-Bootloader in Bank 2 streamen
5. STM32 prüft erneut, tauscht die Bänke, startet neu -> fw_state UPDATING
6. STM32 meldet seine Version an den ESP32 -> current_fw_version
Sie haben einen 1-MB-F407, der nur eine Bank hat. Für 380 KB würde ich die oberen 512 KB als Download-Slot verwenden und einen kleinen Bootloader, der das Image nach der Prüfung dorthin kopiert. Externer Flash funktioniert auch, dann braucht der Bootloader aber den SPI-Treiber.Schalten Sie auf dem Firmware-Tab des Profils die Firmware-Updates ein (standardmäßig aus) und lassen Sie Unsignierte Images zulassen außerhalb des Testaufbaus ausgeschaltet. Updates über LTE sind ebenfalls standardmäßig aus. Setzen Sie bei dem Paket Hardware-Modelle, damit ein ESP32-Image niemals im STM32-Slot landet.Firmware updates (OTA)
We did exactly this on building controllers (STM32 plus an ESP32 modem). Hermetry doesn’t care which chip ends up running the image, it only talks to the device that’s logged in, so the ESP32 is the one that downloads and reports.
When you assign a package, the device gets these shared attributes in one message on v1/attributes/set: fw_title, fw_version, fw_size, fw_checksum, fw_checksum_algorithm (SHA256), fw_url and fw_sig if the package has a detached signature. fw_url is a short-lived HTTPS address, valid for 15 minutes, and the download can resume with an HTTP Range request.
The device reports progress as client attributes: fw_state goes DOWNLOADING, DOWNLOADED, VERIFIED, UPDATING, UPDATED (or FAILED with fw_error), fw_progress 0 to 100 while downloading, and after the reboot current_fw_title and current_fw_version. UPDATED alone isn’t accepted, it wants to see the new running version.
Our flow on the ESP32:
1. fw_* arrives -> check fw_title == "irr-stm32"
2. GET fw_url (Range resume) into ESP32 flash, report fw_progress
3. SHA-256 + Ed25519 check against fw_sig -> fw_state VERIFIED
4. stream image over UART to the STM32 bootloader into bank 2
5. STM32 verifies again, swaps banks, reboots -> fw_state UPDATING
6. STM32 reports its version to ESP32 -> current_fw_version
You have a 1 MB F407, which is single bank, so for 380 KB I’d use the upper 512 KB as the download slot and a small bootloader that copies it over after checking it. External flash works too, but then the bootloader needs the SPI driver.
On the profile’s Firmware tab turn on firmware updates (off by default), and leave Allow unsigned images off outside the test bench. Updates over LTE are off by default too. Set Hardware models on the package so an ESP32 image never ends up in the STM32 slot.

