2023-10-02 11:30 PM
Hi guys,
I'm currently trying to figure out how to flash a new software update on a Discovery kit STM32 B-L4S5I-IOT01A (dual flash bank) via Azure IoT Device Update. I've followed Microsoft's example on Github (link) and it works. What I have trouble with, is to integrate this update logic into another of their base samples.
I've copied the code responsible for handling the update into the second sample. The update is downloaded onto the board, but once it's installed, the board doesn't boot up and I just get "ERROR, ERROR, etc" in the screen output.
Does anyone have an idea? I'm pretty new to all of this. I've double checked that it was written to the the address 0x0810 0000.
2023-10-04 03:25 AM
Or could anyone help/guide me on what to be careful about when flashing to bank 2 + starting the software from it?
2023-10-05 07:56 AM
Hi,
the MCU-related source of information is the application note On-the-fly firmware update for dual bank STM32 microcontrollers AN4767 and more generally the STM32Cube Expansion Package X-CUBE-DBFU.
And the chip reference manual (RM0432) allows to locate the BFB2 and DBANK configuration bits in the FLASH_OPR flash option register.
If you have user data stored in the user flash memory outside the application image (typically in a few dedicated flash pages), do not forget to copy them to the alternate bank before switching, or take into account that their access address must be translated in function of the active boot bank.