Skip to content
Prev Previous commit
QSPIFormat: add option to perform a full erase
  • Loading branch information
pennam committed May 6, 2025
commit a831fd2485bfbeb75b55f3b38d9f510a17c4174e
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ void setup() {
return;
}

root->erase(0x0, root->get_erase_size());
Serial.println("Do you want to perform a full erase of the QSPI flash before proceeding? Y/[n]");
if (true == waitResponse()) {
root->erase(0x0, root->size());
} else {
// Erase only the first sector containing the MBR
root->erase(0x0, root->get_erase_size());
}

MBRBlockDevice::partition(root, 1, 0x0B, 0, 1 * 1024 * 1024);
MBRBlockDevice::partition(root, 2, 0x0B, 1 * 1024 * 1024, 6 * 1024 * 1024);
MBRBlockDevice::partition(root, 3, 0x0B, 6 * 1024 * 1024, 7 * 1024 * 1024);
Expand Down