11
11
QSPIFBlockDevice root (QSPI_SO0, QSPI_SO1, QSPI_SO2, QSPI_SO3, QSPI_SCK, QSPI_CS, QSPIF_POLARITY_MODE_1, 40000000 );
12
12
mbed::MBRBlockDevice wifi_data (&root, 1 );
13
13
mbed::MBRBlockDevice ota_data (&root, 2 );
14
- mbed::MBRBlockDevice user_data (&root, 3 );
14
+ mbed::MBRBlockDevice kvstore_data (&root, 3 );
15
+ mbed::MBRBlockDevice user_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 3: 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: Provisioning KVStore 1MB" );
57
+ Serial.println (" Partition 4: User data 7MB" ),
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 ();
@@ -69,12 +72,14 @@ void setup() {
69
72
70
73
mbed::MBRBlockDevice::partition (&root, 1 , 0x0B , 0 , 1024 * 1024 );
71
74
if (default_scheme) {
72
- mbed::MBRBlockDevice::partition (&root, 3 , 0x0B , 14 * 1024 * 1024 , 14 * 1024 * 1024 );
73
- mbed::MBRBlockDevice::partition (&root, 2 , 0x0B , 1024 * 1024 , 14 * 1024 * 1024 );
75
+ mbed::MBRBlockDevice::partition (&root, 2 , 0x0B , 1024 * 1024 , 13 * 1024 * 1024 );
76
+ mbed::MBRBlockDevice::partition (&root, 3 , 0x0B , 13 * 1024 * 1024 , 14 * 1024 * 1024 );
77
+ mbed::MBRBlockDevice::partition (&root, 4 , 0x0B , 14 * 1024 * 1024 , 14 * 1024 * 1024 );
74
78
// use space from 15.5MB to 16 MB for another fw, memory mapped
75
79
} else {
76
80
mbed::MBRBlockDevice::partition (&root, 2 , 0x0B , 1024 * 1024 , 6 * 1024 * 1024 );
77
- mbed::MBRBlockDevice::partition (&root, 3 , 0x0B , 6 * 1024 * 1024 , 14 * 1024 * 1024 );
81
+ mbed::MBRBlockDevice::partition (&root, 3 , 0x0B , 6 * 1024 * 1024 , 7 * 1024 * 1024 );
82
+ mbed::MBRBlockDevice::partition (&root, 4 , 0x0B , 7 * 1024 * 1024 , 14 * 1024 * 1024 );
78
83
// use space from 15.5MB to 16 MB for another fw, memory mapped
79
84
}
80
85
@@ -83,7 +88,7 @@ void setup() {
83
88
Serial.println (" Error formatting WiFi partition" );
84
89
return ;
85
90
}
86
-
91
+
87
92
err = ota_data_fs.reformat (&ota_data);
88
93
if (err) {
89
94
Serial.println (" Error formatting OTA partition" );
0 commit comments