Program the STM32 with ESP8266


Has anyone done programming the STM32 (with Arduino platform) via the ESP8266

Like the AVR-ISP but for STM32?

Hi @gproduct, I’m intrigued, did you finally programmed an STM32 with an ESP8266?
But, why would you want to do that?, did you need to program over the air the STM32?, why not start using an ESP32 directly?.
Did you ask in the Espriff forums?

There does exist proof-of-concept code for the ESP8266 to act a SWD programmer which can read and write values into the flash of a SWD capable device via SWDIO & SWCLK.

Maybe an extension thereof can flash / stream a complete firmware bin file to an STM32 MCU?

1 Like

@maxgerhardt Well, that’s new for me, useful indeed as a resource.
Still struggling to understand the need of doing this over using directly the microcontroller available on a, for example ESP32, or using a wireless module as a dongle for a main Cortex uC.
I searched the scanlime/esp8266-arm-swd for links on this with no success, would you send me some references, or point me in the right direction regarding this need?
Thank you

Well there might be use cases in which an STM32 chip is absolutely needed (special coprocessing, or needed peripherals), but I also can’t think of many.

There are a lot of good reasons which imply a need for FOTA (firmware over the air), mostly being adding features and patching security holes in in-the-field devices. But the process has to be secure, otherwise you have a loophole with which these devices can be taken over. FOTA is even implemented as a standard feature for the Arduino ESP8266 and ESP32 frameworks (e.g. Tech Note 082 - ESP32 Over-the-Air (OTA) Updating - YouTube). Recently, with the advent of wireless technologies like LoRa(WAN), FOTA has come up again (see e.g. STM32 + LoRa + FOTA and mbed-os examples).

1 Like

I was thinking on that maybe if an STM with FOTA is required an STM32WB could be used, the docs state that it handles it.

Thank you for the references, I’ll check them, haven’t read much about the LoRa yet so it’s a good start.