Hi,
I have noticed that each time I re-flash my Maple r5, the entire flash (128 pages) are erased, (probably using the STM32 Mass Erase command), although the boot loader only uses 15,616 KB which is 16 pages (out of 128 available).
Is there a way to re-flash only the boot-loader section or any other defined part of the flash, keeping intact the rest (my saved data)?
Thanks
samtal
Keep flash pages while reflashing bootloader only
(7 posts) (3 voices)-
Posted 4 years ago #
-
Are you using JTAG or the serialbootloader?
Posted 4 years ago # -
poslathian -- I believe samtal is using the IDE, so that would be the usual flash upload.
samtal, the bootloader should only be overwriting the pages that it needs. Therefore, if your code doesn't occupy all of flash, the pages at the end of available flash should not be overwritten. Try using the last couple of pages of flash as your stable memory, perhaps?
Posted 4 years ago # -
Hi,
Thanks poslathian and mbolivar,
As mbolivar wrote, I use the Maple IDE and reflash using the Python.
Following your post, I rechecked using the easy flash program I wrote, and unfortunately I reassured that when reflashing, the entire flash is cleared.
I wrote data into page 126 which is the next to last, and after reflashing (and reloading my program for the test) although the bootloader only loads pages 0 through 16, I found out that page 126 was also clear.
My assumption is that the reflash uses the global erase command.
I use the two last pages for my permanent data (calibration data) that must be reloaded each time I reflash.
The reflash in itself is a burden - it is mainly the result of USB problems, for which reason I use now mainly one of the Serial ports rather than the USB.
Will there be a cure to the unstable Maple USB??Posted 4 years ago # -
A reminder:
I made a flash read/write/erase demo that can be used to easily test the flash.
It's on http://pastebin.com/h0CxGRQ7. (revised 25 sept.)
samtal.Posted 4 years ago # -
Can anyone answer the question or advice on how to avoid erasure of the entire flash when re-flashing?
This is most annoying phenomenon when combined with the USB port instability, that necessitates frequent reflash (occasionally this is the only way out...).
samtalPosted 4 years ago # -
Hi samtal,
Unfortunately, based on your description, it seems that currently, your best bet is to modify the bootloader. This will require knowledge of C. More information on the bootloader is available here:
Posted 4 years ago #
Reply
You must log in to post.