Page 1 of 1

STM32L432KC OTA using esp32 how to do it?

Posted: Mon Aug 30, 2021 5:13 pm
by FRANCISCOGIMENO
Hello can someone give me some idea of how to update the sketch of the st using an esp32.

I've been looking but the BOOT0 lines are not available on the pins on this board.

The idea is to update the program via wifi.

I don't know if it can be done somehow.

Any ideas?

Greetings and thank you

Re: STM32L432KC OTA using esp32 how to do it?

Posted: Tue Aug 31, 2021 8:48 am
by AndrewBCN
I suppose there are many ways to achieve that but I would suggest roughly the following:

1) download the stm32 binary to the ESP32 RAM using the WiFi connection.

2) Flash the STM32L432KC using SWD from the ESP32.

Which means you have to connect four wires from the ESP32 to the STM32 and implement an SWD algorithm on the ESP32. That should not be too difficult, but it's not easy either. Perhaps check GitHub if somebody has already implemented something similar ?

Re: STM32L432KC OTA using esp32 how to do it?

Posted: Tue Aug 31, 2021 10:02 am
by FRANCISCOGIMENO
Hi, thanks for your help.
I assume you are referring to ICP (In-Circuit Programming) programming. Is that so?

Re: STM32L432KC OTA using esp32 how to do it?

Posted: Tue Aug 31, 2021 12:36 pm
by mrburnette

Re: STM32L432KC OTA using esp32 how to do it?

Posted: Wed Sep 01, 2021 8:30 am
by Juraj
my ArduinoOTA library uses a self update approach, where the esp or any other network adapter is just that, a network adapter.
the library supports two ways:

first way is to write the new binary in upper half of the flash and then copy it to run location and reset. this is now supported for SAMD21, SAMD51, nRF51, nRF52 and for classic ATmega with at least 64kB flash and Optiboot. STM32 could be supported the same way as the other ARM chips, but it is still not done. https://github.com/jandrassy/ArduinoOTA/issues/4

other option is to use SD bootloader and SD card. then the library only has to store the OTA update binary on the SD card and invoke reset