Page 1 of 1

Firmware update through Ethernet

Posted: Wed Jul 08, 2020 4:21 pm
by GaelZorro
Hello to all,

I'm quite new to the STM32, I made some projects with ESP8266 / ESP32 and I'm in the process of porting these to customs boards with STM32F103 and a W5500 ethernet interface base because I think it is better solution...
One feature that I'm using very often is the remote firmware update, via an HTTP web server or by downloading the BIN file from a specific URL.
These particular units will be hidden in not easily accessible locations so a remote firmware update without having to plug in a USB or FTDI is really important!

I'm looking for examples of this using stm32duino, but I can't seem to find any. I am not an expert programmer, do you think it would be possible for me to port something like the "Update" library from the arduino-esp32 : (https://github.com/espressif/arduino-es ... ies/Update) for use onto the STM32F103?

Thanks in advance for any advice!

Re: Firmware update through Ethernet

Posted: Thu Jul 09, 2020 8:32 am
by Juraj
My ArduinoOTA library still doesn't have support for STM32, but you could try the upload over SD card with the SD bootloader. Use the ATmega_SD example.
https://github.com/jandrassy/ArduinoOTA
viewtopic.php?f=67&t=144

I work on testing it, but I can't make my Blue Pill reliably work with SPI devices. (I blame my bad soldering of headers right now.)

Re: Firmware update through Ethernet

Posted: Thu Jul 09, 2020 4:16 pm
by GaelZorro
Thanks for the suggestion!

I've seen that it is possible, but due to the fact that these units will be hidden there's no easy way to access the hardware.

I guess I'll play around with it and try to make something work, I don't see why it wouldn't be possible. The MCU I work with is the STM32F103RE and with 512K of flash there's plenty of space.

Re: Firmware update through Ethernet

Posted: Thu Jul 09, 2020 4:55 pm
by Juraj
I don't suggest update from SD card. The file to SD card is uploaded over network. Then the MCU is reset and the SD bootloader bootloads the binary.

Of course better is to use the upper half of the internal flash to store the uploaded binary and then before reset copy it to final location in flash with a function running in RAM.