@@ -12,6 +12,7 @@ QSPIFBlockDevice root(QSPI_SO0, QSPI_SO1, QSPI_SO2, QSPI_SO3, QSPI_SCK, QSPI_CS
12
12
mbed::MBRBlockDevice wifi_data (&root, 1 );
13
13
mbed::MBRBlockDevice ota_data (&root, 2 );
14
14
mbed::MBRBlockDevice user_data (&root, 3 );
15
+ mbed::MBRBlockDevice kvstore_data (&root, 4 );
15
16
mbed::FATFileSystem wifi_data_fs (" wlan" );
16
17
mbed::FATFileSystem ota_data_fs (" fs" );
17
18
mbed::FileSystem * user_data_fs;
@@ -47,11 +48,13 @@ void setup() {
47
48
Serial.println (" Available partition schemes:" );
48
49
Serial.println (" \n Partition scheme 1" );
49
50
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" );
51
53
Serial.println (" \n Partition scheme 2" );
52
54
Serial.println (" Partition 1: WiFi firmware and certificates 1MB" );
53
55
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" );
55
58
Serial.println (" \n Do you want to use partition scheme 1? Y/[n]" );
56
59
Serial.println (" If No, partition scheme 2 will be used." );
57
60
bool default_scheme = waitResponse ();
@@ -89,12 +92,14 @@ void setup() {
89
92
90
93
mbed::MBRBlockDevice::partition (&root, 1 , 0x0B , 0 , 1024 * 1024 );
91
94
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 );
94
98
// use space from 15.5MB to 16 MB for another fw, memory mapped
95
99
} 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 );
98
103
// use space from 15.5MB to 16 MB for another fw, memory mapped
99
104
}
100
105
@@ -103,7 +108,7 @@ void setup() {
103
108
Serial.println (" Error formatting WiFi partition" );
104
109
return ;
105
110
}
106
-
111
+
107
112
err = ota_data_fs.reformat (&ota_data);
108
113
if (err) {
109
114
Serial.println (" Error formatting OTA partition" );
0 commit comments