@@ -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 ();
@@ -88,12 +91,14 @@ void setup() {
88
91
89
92
mbed::MBRBlockDevice::partition (&root, 1 , 0x0B , 0 , 1024 * 1024 );
90
93
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 );
93
97
// use space from 15.5MB to 16 MB for another fw, memory mapped
94
98
} 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 );
97
102
// use space from 15.5MB to 16 MB for another fw, memory mapped
98
103
}
99
104
@@ -102,7 +107,7 @@ void setup() {
102
107
Serial.println (" Error formatting WiFi partition" );
103
108
return ;
104
109
}
105
-
110
+
106
111
err = ota_data_fs.reformat (&ota_data);
107
112
if (err) {
108
113
Serial.println (" Error formatting OTA partition" );
0 commit comments