From 574abc2c2fdf5558a72dfca9eb430e2cc2c5d936 Mon Sep 17 00:00:00 2001 From: linuswck Date: Tue, 12 Mar 2024 11:26:45 +0800 Subject: [PATCH] Add instructions to erase flash settings with DFU --- README.md | 8 +++++++- erase_flash_settings.bin | Bin 0 -> 131072 bytes 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 erase_flash_settings.bin diff --git a/README.md b/README.md index 34de5e1..158426b 100644 --- a/README.md +++ b/README.md @@ -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 ### 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: @@ -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" ``` +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 ```shell openocd -f interface/stlink.cfg -f target/stm32f4x.cfg -c "program target/thumbv7em-none-eabihf/debug/kirdy verify reset; exit" diff --git a/erase_flash_settings.bin b/erase_flash_settings.bin new file mode 100644 index 0000000000000000000000000000000000000000..e2c8fe92d8237d3c9169891e23a1b7d6ae8e0dcb GIT binary patch literal 131072 zcmeIuF#!Mo0K%a4Pwin1h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM z7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM7%*VKfB^#r3>YwAz<>b* z1`HT5V8DO@0|pEjFkrxd0RsjM7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd z0RsjM7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM7%*VKfB^#r3>YwA zz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@0|pEj zFkrxd0RsjM7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM7%*VKfB^#r z3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@ z0|pEjFkrxd0RsjM7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM7%*VK zfB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM7%*VKfB^#r3>YwAz<>b*1`HT5 zV8DO@0|pEjFkrxd0RsjM7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM z7%*VKfB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM7%*VKfB^#r3>YwAz<>b* W1`HT5V8DO@0|pEjFkrxdfe#D-9smIV literal 0 HcmV?d00001