I am playing with STM32F4DISCOVERY kit. I am loading a simple "blink led" program from jeremyherbert. I managed to compile the code and load it with OpenOCD. I loaded the code with the following command:
flash write_image main.bin 0x08000000
The program loads and runs after resetting the board. However, write_image
command works only after I erase flash with:
flash erase_sector 0 0 11
If I do not erase flash, even if I do write_image
with success, the program won't run (the leds won't blink).
Question: Why do I need to erase_sector
before writing image? Why write_image
alone is not enough?