0

I would like to remotely update the firmware of my STM32WLE5 device. I can transfer the new binary file from the server to the STM's SRAM using only my custom link, which means I cannot utilize other native update procedures provided by STM, such as UART. However, I'm unsure about what steps to take with the data once it's in the SRAM.

  1. Does anyone know how to update the firmware using the data stored in the SRAM?
  2. Is it possible to execute the new firmware exclusively from the SRAM and, in case of a reset (due to an error in the new firmware, for example), load the old firmware from the flash? If it is possible, how can it be done?
  3. I have come across some information about IAP. Is that what I need for this purpose?
  4. Is it feasible to update the firmware on the fly and retain certain data without requiring any additional hardware or EEPROM?

I would greatly appreciate any answers or guidance regarding any of these questions!

Foreen
  • 369
  • 2
  • 17
  • This is 4 questions, and some people might be able to answer some of them, but not others, and may be reluctant to actually post an answer for that reason. 1) You'll probably need some kind of bootloader that can detect new firmware in RAM and write it to flash. 2) Probably. 3) I don't know. 4) Sure, you can partition your flash how you like. You can have code in one section and data in a different section. – pmacfarlane Jul 05 '23 at 18:40
  • It's not particularly difficult to write to flash memory. You could split your flash into three areas: one for a fixed bootloader and two for the two versions of the firmware. So during an update, you write the firmware to one of the firmware areas while the other contains the running code. The challenge is how to write position-independent code or how to manage firmware versions that have to be either in the upper or the lower area. It would be easier if the MCU had dual flash capability but the STM32WLE5 series does not. – Codo Jul 05 '23 at 20:04
  • You should break down your task into simpler parts. You can easily run code from any address, Flash or SRAM, by casting that address to a function pointer and calling it (don't forget the least signigicant of address bit must always be set (1), because Thumb instruction set). That code can erase and write to Flash. You need to know where you will place new firmware, and, as you said, maybe you need two copies of firmware, so you need a selection mechanism to choose which one to run. A good idea would be to have a checksum attached to new firmware at the very least. – Ilya Jul 06 '23 at 08:33

0 Answers0