Restoring original flash contents to the STM32F4-Discovery

Now we will test restoring the binary image that we earlier got from dumping the original contents of the flash memory.
Our unique flash bank looks as follows:

We can first verify the image file:

We can then naively test to restore the image without first erasing the bank:

This is not surprising, although I have seen it go through without an error message before (I am not sure what really happened in that case).
Lets now try to first erase the whole bank.
We check the contents of the first word:

We recognize the first word from earlier. Now we erase the whole bank (i.e. the whole flash memory):

It does look like the flash memory is erased. Now lets restore the original image:

This worked too! After the reset, the LEDs are flashing as they did before, instead of staying unlit when I run reset just after the erasing.

Leave a Reply

Your email address will not be published. Required fields are marked *