Skip to content

Commit 0abb5f8

Browse files
committed
wifi: make sure memory mapped firmware area is erased before writing
1 parent e28dd9e commit 0abb5f8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libraries/STM32H747_System/examples/WiFiFirmwareUpdater/WiFiFirmwareUpdater.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ void setup() {
107107
byte_count = 0;
108108
const uint32_t offset = 15 * 1024 * 1024 + 1024 * 512;
109109

110+
// Make sure QSPI is erased before programming
111+
Serial.println("Erasing memory mapped firmware area...");
112+
err = root.erase(14 * 1024 * 1024, 2 * 1024 * 1024);
113+
if (err != 0) {
114+
Serial.println("Error erasing memory mapped firmware area");
115+
}
110116
Serial.println("Flashing memory mapped firmware");
111117
printProgress(byte_count, file_size, 10, true);
112118
while (byte_count < file_size) {

0 commit comments

Comments
 (0)