1
0
Fork 0

Add instructions to erase flash settings with DFU

This commit is contained in:
linuswck 2024-03-12 11:26:45 +08:00
parent a9dbff8250
commit 574abc2c2f
2 changed files with 7 additions and 1 deletions

View File

@ -65,7 +65,7 @@ On a Windows machine install [st.com](https://st.com) DfuSe USB device firmware
- cycle power to leave DFU update mode - cycle power to leave DFU update mode
### Erasing Flash Settings ### Erasing Flash Settings
The flash settings are stored in the last flash sector(ID: 11) of bank 0 of stm32f405. With JTAG/SWD adapter connected, you can erase the flash settings without erasing the firmware with the following commands. You may find it useful if you have set the wrong IP settings. The flash settings are stored in the last flash sector(ID: 11) of bank 0 of stm32f405. You can erase it with JTAG/SWD adapter or by putting the device in Dfu mode. You may find it useful if you have set network settings incorrectly.
With JTAG/SWD adapter connected, issue the following command: With JTAG/SWD adapter connected, issue the following command:
@ -73,6 +73,12 @@ With JTAG/SWD adapter connected, issue the following command:
openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c "flash init; init; halt; flash erase_sector 0 11 last; reset; exit" openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c "flash init; init; halt; flash erase_sector 0 11 last; reset; exit"
``` ```
With STM32 in DFU Mode, connect the USB Type C cable and then issue the following command:
```
dfu-util -a 0 -s 0x080E0000:leave -D erase_flash_settings.bin
```
### OpenOCD ### OpenOCD
```shell ```shell
openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c "program target/thumbv7em-none-eabihf/debug/kirdy verify reset; exit" openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c "program target/thumbv7em-none-eabihf/debug/kirdy verify reset; exit"

BIN
erase_flash_settings.bin Normal file

Binary file not shown.