From 5ba8c67706f4f5e1a16d4aebed051d1e5789d1fe Mon Sep 17 00:00:00 2001 From: Andrea Gilardoni Date: Mon, 23 Sep 2024 14:03:08 +0200 Subject: [PATCH] erasing flash before creating a new partitioning scheme --- .../STM32H747_System/examples/QSPIFormat/QSPIFormat.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino b/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino index caa7fc4a1..2ffe97591 100644 --- a/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino +++ b/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino @@ -60,6 +60,12 @@ void setup() { Serial.println("Do you want to proceed? Y/[n]"); if (true == waitResponse()) { + if (root.init() != QSPIF_BD_ERROR_OK) { + Serial.println(F("Error: QSPI init failure.")); + return; + } + + root.erase(0, root.size()); mbed::MBRBlockDevice::partition(&root, 1, 0x0B, 0, 1024 * 1024); if(default_scheme) { mbed::MBRBlockDevice::partition(&root, 3, 0x0B, 14 * 1024 * 1024, 14 * 1024 * 1024);