Skip to content

Commit

Permalink
added an additional parition for provisioning in QSPIFormat sketch
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni committed Sep 30, 2024
1 parent c645010 commit 9400dab
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions libraries/STM32H747_System/examples/QSPIFormat/QSPIFormat.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
}

Expand Down

0 comments on commit 9400dab

Please sign in to comment.