2023-01-11 04:43 AM
Hi,
I'm having a STM32G474 with Bootloader block (0x0800 0000 - 0x0800 4FFF) and Application block (0x0800 5000 - 0x0807 FFFF).
I need to update Bootloader from Application, by copying a new bootloader located on higher memory. Is it possible ?
I'm using the same code of the bootloader to erase the pages 0 to 4 but no success. I can't even write on the bootloader block.
So is it possible to erase the bootloader from the running application ?
Thanks
Solved! Go to Solution.
2023-01-11 04:54 AM
I mean you can , but is this safe? Secondary G474 is dual bank with protections , if you set protect boot ...
2023-01-11 04:54 AM
I mean you can , but is this safe? Secondary G474 is dual bank with protections , if you set protect boot ...
2023-01-11 05:05 AM
I agree, it's not safe but it's the only solution to upgrade systems.
2023-01-11 05:25 AM
Show the same code and return values.
2023-01-11 06:04 AM
BOOT_LOCK was set. Thank you
2023-01-14 07:16 PM
Bootloader must be immutable and permanent. If it seems that you have a need to update it, then most likely you have to make a second bootloader. And that second bootloader can actually be just like a second minimal "updater" application, which updates the main firmware. After that, the main firmware can also update the updater. The bootloader doesn't have to do the everyday updates, but it always has to be capable of recovering a device into a working state regardless of what is the state of the updater and main firmware.
2023-01-18 03:07 AM
It's more complicated than that.
On the board, we have changed the MCU (due to stock rupture) so it was the occasion to make a new board. we decided to double the size of the external flash. (divided in different blocks to store menu languages and firmwares of daughter boards)
During normal use, if we want to upgrade the a firmware we have to transfer it by bluetooth and save it on the external flash. So since the flash doubled, we changed all blocks locations and for the bootloader to find the good new location we have to change it too.