Skip to content

Commit 392cc64

Browse files
added an additional parition for provisioning in QSPIFormat sketch
1 parent 3c959ab commit 392cc64

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Diff for: libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino

+12-7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ QSPIFBlockDevice root(QSPI_SO0, QSPI_SO1, QSPI_SO2, QSPI_SO3, QSPI_SCK, QSPI_CS
1212
mbed::MBRBlockDevice wifi_data(&root, 1);
1313
mbed::MBRBlockDevice ota_data(&root, 2);
1414
mbed::MBRBlockDevice user_data(&root, 3);
15+
mbed::MBRBlockDevice kvstore_data(&root, 4);
1516
mbed::FATFileSystem wifi_data_fs("wlan");
1617
mbed::FATFileSystem ota_data_fs("fs");
1718
mbed::FileSystem * user_data_fs;
@@ -47,11 +48,13 @@ void setup() {
4748
Serial.println("Available partition schemes:");
4849
Serial.println("\nPartition scheme 1");
4950
Serial.println("Partition 1: WiFi firmware and certificates 1MB");
50-
Serial.println("Partition 2: OTA and user data 13MB");
51+
Serial.println("Partition 2: OTA and user data 12MB");
52+
Serial.println("Partition 4: Provisioning KVStore 1MB");
5153
Serial.println("\nPartition scheme 2");
5254
Serial.println("Partition 1: WiFi firmware and certificates 1MB");
5355
Serial.println("Partition 2: OTA 5MB");
54-
Serial.println("Partition 3: User data 8MB"),
56+
Serial.println("Partition 3: User data 7MB"),
57+
Serial.println("Partition 4: Provisioning KVStore 1MB");
5558
Serial.println("\nDo you want to use partition scheme 1? Y/[n]");
5659
Serial.println("If No, partition scheme 2 will be used.");
5760
bool default_scheme = waitResponse();
@@ -89,12 +92,14 @@ void setup() {
8992

9093
mbed::MBRBlockDevice::partition(&root, 1, 0x0B, 0, 1024 * 1024);
9194
if(default_scheme) {
92-
mbed::MBRBlockDevice::partition(&root, 3, 0x0B, 14 * 1024 * 1024, 14 * 1024 * 1024);
93-
mbed::MBRBlockDevice::partition(&root, 2, 0x0B, 1024 * 1024, 14 * 1024 * 1024);
95+
mbed::MBRBlockDevice::partition(&root, 4, 0x0B, 13 * 1024 * 1024, 14 * 1024 * 1024);
96+
mbed::MBRBlockDevice::partition(&root, 3, 0x0B, 13 * 1024 * 1024, 13 * 1024 * 1024);
97+
mbed::MBRBlockDevice::partition(&root, 2, 0x0B, 1024 * 1024, 13 * 1024 * 1024);
9498
// use space from 15.5MB to 16 MB for another fw, memory mapped
9599
} else {
96-
mbed::MBRBlockDevice::partition(&root, 2, 0x0B, 1024 * 1024, 6 * 1024 * 1024);
97-
mbed::MBRBlockDevice::partition(&root, 3, 0x0B, 6 * 1024 * 1024, 14 * 1024 * 1024);
100+
mbed::MBRBlockDevice::partition(&root, 4, 0x0B, 1024 * 1024, 6 * 1024 * 1024);
101+
mbed::MBRBlockDevice::partition(&root, 3, 0x0B, 6 * 1024 * 1024, 13 * 1024 * 1024);
102+
mbed::MBRBlockDevice::partition(&root, 2, 0x0B, 13* 1024 * 1024, 14 * 1024 * 1024);
98103
// use space from 15.5MB to 16 MB for another fw, memory mapped
99104
}
100105

@@ -103,7 +108,7 @@ void setup() {
103108
Serial.println("Error formatting WiFi partition");
104109
return;
105110
}
106-
111+
107112
err = ota_data_fs.reformat(&ota_data);
108113
if (err) {
109114
Serial.println("Error formatting OTA partition");

0 commit comments

Comments
 (0)