@@ -12,6 +12,7 @@ QSPIFBlockDevice root(QSPI_SO0, QSPI_SO1, QSPI_SO2, QSPI_SO3, QSPI_SCK, QSPI_CS
1212mbed::MBRBlockDevice wifi_data (&root, 1 );
1313mbed::MBRBlockDevice ota_data (&root, 2 );
1414mbed::MBRBlockDevice user_data (&root, 3 );
15+ mbed::MBRBlockDevice kvstore_data (&root, 4 );
1516mbed::FATFileSystem wifi_data_fs (" wlan" );
1617mbed::FATFileSystem ota_data_fs (" fs" );
1718mbed::FileSystem * user_data_fs;
@@ -47,11 +48,13 @@ void setup() {
4748 Serial.println (" Available partition schemes:" );
4849 Serial.println (" \n Partition 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 (" \n Partition 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 (" \n Do 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 ();
@@ -88,12 +91,14 @@ void setup() {
8891
8992 mbed::MBRBlockDevice::partition (&root, 1 , 0x0B , 0 , 1024 * 1024 );
9093 if (default_scheme) {
91- mbed::MBRBlockDevice::partition (&root, 3 , 0x0B , 14 * 1024 * 1024 , 14 * 1024 * 1024 );
92- mbed::MBRBlockDevice::partition (&root, 2 , 0x0B , 1024 * 1024 , 14 * 1024 * 1024 );
94+ mbed::MBRBlockDevice::partition (&root, 4 , 0x0B , 13 * 1024 * 1024 , 14 * 1024 * 1024 );
95+ mbed::MBRBlockDevice::partition (&root, 3 , 0x0B , 13 * 1024 * 1024 , 13 * 1024 * 1024 );
96+ mbed::MBRBlockDevice::partition (&root, 2 , 0x0B , 1024 * 1024 , 13 * 1024 * 1024 );
9397 // use space from 15.5MB to 16 MB for another fw, memory mapped
9498 } else {
95- mbed::MBRBlockDevice::partition (&root, 2 , 0x0B , 1024 * 1024 , 6 * 1024 * 1024 );
96- mbed::MBRBlockDevice::partition (&root, 3 , 0x0B , 6 * 1024 * 1024 , 14 * 1024 * 1024 );
99+ mbed::MBRBlockDevice::partition (&root, 4 , 0x0B , 1024 * 1024 , 6 * 1024 * 1024 );
100+ mbed::MBRBlockDevice::partition (&root, 3 , 0x0B , 6 * 1024 * 1024 , 13 * 1024 * 1024 );
101+ mbed::MBRBlockDevice::partition (&root, 2 , 0x0B , 13 * 1024 * 1024 , 14 * 1024 * 1024 );
97102 // use space from 15.5MB to 16 MB for another fw, memory mapped
98103 }
99104
@@ -102,7 +107,7 @@ void setup() {
102107 Serial.println (" Error formatting WiFi partition" );
103108 return ;
104109 }
105-
110+
106111 err = ota_data_fs.reformat (&ota_data);
107112 if (err) {
108113 Serial.println (" Error formatting OTA partition" );
0 commit comments