Skip to content

Commit a107e88

Browse files
committed
Always erase entire sector
1 parent 760c106 commit a107e88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/Nano33_System/examples/Nano33_updateBootloader/Nano33_updateBootloader.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ void applyUpdate(uint32_t address) {
8080
break;
8181
}
8282

83+
flash.erase(addr + pointer, sector_size);
84+
8385
if ((len - pointer) < sector_size) {
8486
sector_size = len - pointer;
8587
}
86-
87-
flash.erase(addr + pointer, sector_size);
8888

8989
// Program page
9090
if (addr == MBR_ADDR) {

0 commit comments

Comments
 (0)