mjuhanne/idf-stm-flash — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a reusable ESP32 ESP IDF component that can update an STM32 firmware over UART.

I want the ESP32 to download a firmware file from an HTTP URL, optionally download or accept an MD5 checksum, verify the file, then either compare it with the STM32 flash or erase and write it. It should be able to keep small firmware files in memory so I don’t need a SPIFFS partition. Please include clear progress and error callbacks so my app can show what is happening during download, erase, write, and verify.

Also include a simple example for an STM32F030 style setup. The example should start in verify only mode so it is safe by default, with one obvious setting to enable real flashing. Support the normal RESET and BOOT0 pin method, but also allow the UART only flow where the STM32 app jumps into its built in bootloader after receiving a command.

Keep the code clean and documented enough that I can drop it into another ESP32 plus STM32 project. Look up current ESP IDF docs online if needed.

Want more depth? Deep Reverse