From e33947b0de60d127fb3cc934858e84656436a8fe Mon Sep 17 00:00:00 2001 From: Andrea Gilardoni Date: Mon, 23 Sep 2024 14:02:23 +0200 Subject: [PATCH 1/3] unifying codestile and removing trailing white spaces --- libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino b/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino index 8d2b537dc..caa7fc4a1 100644 --- a/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino +++ b/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino @@ -3,7 +3,7 @@ #include "LittleFileSystem.h" #include "FATFileSystem.h" -#ifndef CORE_CM7 +#ifndef CORE_CM7 #error Format QSPI flash by uploading the sketch to the M7 core instead of the M4 core. #endif @@ -76,7 +76,7 @@ void setup() { Serial.println("Error formatting WiFi partition"); return; } - + err = ota_data_fs.reformat(&ota_data); if (err) { Serial.println("Error formatting OTA partition"); From c645010b14d6ffe294c689834a2d4556774d7ec0 Mon Sep 17 00:00:00 2001 From: Andrea Gilardoni Date: Mon, 23 Sep 2024 14:03:08 +0200 Subject: [PATCH 2/3] 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..b3626afc1 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(0x0, root.get_erase_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); From 9400dabdf4e2d10e6b3bdea43489e7c0669b8a2b Mon Sep 17 00:00:00 2001 From: Andrea Gilardoni Date: Mon, 23 Sep 2024 15:43:28 +0200 Subject: [PATCH 3/3] added an additional parition for provisioning in QSPIFormat sketch --- .../examples/QSPIFormat/QSPIFormat.ino | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino b/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino index b3626afc1..ef5a575b1 100644 --- a/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino +++ b/libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino @@ -47,11 +47,13 @@ void setup() { Serial.println("Available partition schemes:"); Serial.println("\nPartition scheme 1"); Serial.println("Partition 1: WiFi firmware and certificates 1MB"); - Serial.println("Partition 2: OTA and user data 13MB"); + Serial.println("Partition 2: OTA and user data 12MB"); + Serial.println("Partition 3: Provisioning KVStore 1MB"); Serial.println("\nPartition scheme 2"); Serial.println("Partition 1: WiFi firmware and certificates 1MB"); Serial.println("Partition 2: OTA 5MB"); - Serial.println("Partition 3: User data 8MB"), + Serial.println("Partition 3: User data 7MB"), + Serial.println("Partition 4: Provisioning KVStore 1MB"); Serial.println("\nDo you want to use partition scheme 1? Y/[n]"); Serial.println("If No, partition scheme 2 will be used."); bool default_scheme = waitResponse(); @@ -68,12 +70,14 @@ void setup() { mbed::MBRBlockDevice::partition(&root, 1, 0x0B, 0, 1024 * 1024); if(default_scheme) { - mbed::MBRBlockDevice::partition(&root, 3, 0x0B, 14 * 1024 * 1024, 14 * 1024 * 1024); - mbed::MBRBlockDevice::partition(&root, 2, 0x0B, 1024 * 1024, 14 * 1024 * 1024); + mbed::MBRBlockDevice::partition(&root, 2, 0x0B, 1024 * 1024, 13 * 1024 * 1024); + mbed::MBRBlockDevice::partition(&root, 3, 0x0B, 13 * 1024 * 1024, 13 * 1024 * 1024); + mbed::MBRBlockDevice::partition(&root, 4, 0x0B, 13 * 1024 * 1024, 14 * 1024 * 1024); // use space from 15.5MB to 16 MB for another fw, memory mapped } else { mbed::MBRBlockDevice::partition(&root, 2, 0x0B, 1024 * 1024, 6 * 1024 * 1024); - mbed::MBRBlockDevice::partition(&root, 3, 0x0B, 6 * 1024 * 1024, 14 * 1024 * 1024); + mbed::MBRBlockDevice::partition(&root, 3, 0x0B, 6 * 1024 * 1024, 13 * 1024 * 1024); + mbed::MBRBlockDevice::partition(&root, 4, 0x0B, 13* 1024 * 1024, 14 * 1024 * 1024); // use space from 15.5MB to 16 MB for another fw, memory mapped }