6
6
7
7
QSPIFBlockDevice root (PD_11, PD_12, PF_7, PD_13, PF_10, PG_6, QSPIF_POLARITY_MODE_1, 40000000 );
8
8
mbed::MBRBlockDevice wifi_data (&root, 1 );
9
- mbed::MBRBlockDevice other_data (&root, 2 );
10
9
mbed::FATFileSystem wifi_data_fs (" wlan" );
11
10
mbed::FATFileSystem other_data_fs (" fs" );
12
11
@@ -23,8 +22,8 @@ void setup() {
23
22
Serial.begin (115200 );
24
23
while (!Serial);
25
24
26
- mbed::MBRBlockDevice::partition (&root, 1 , 0x0B , 0 , 1024 * 1024 * 8 );
27
- mbed::MBRBlockDevice::partition (&root, 2 , 0x0B , 1024 * 1024 * 8 , 2048 * 1024 * 8 );
25
+ mbed::MBRBlockDevice::partition (&root, 1 , 0x0B , 0 , 1024 * 1024 );
26
+ // use space from 15.5MB to 16 MB for another fw, memory mapped
28
27
29
28
int err = wifi_data_fs.mount (&wifi_data);
30
29
if (err) {
@@ -34,14 +33,6 @@ void setup() {
34
33
err = wifi_data_fs.reformat (&wifi_data);
35
34
}
36
35
37
- err = other_data_fs.mount (&other_data);
38
- if (err) {
39
- // Reformat if we can't mount the filesystem
40
- // this should only happen on the first boot
41
- Serial.println (" No filesystem found, formatting... " );
42
- err = other_data_fs.reformat (&other_data);
43
- }
44
-
45
36
DIR *dir;
46
37
struct dirent *ent;
47
38
@@ -75,6 +66,8 @@ void setup() {
75
66
int ret = fwrite (wifi_firmware_image_data, 421098 , 1 , fp);
76
67
fclose (fp);
77
68
69
+ root.program (wifi_firmware_image_data, 15 * 1024 * 1024 + 1024 * 512 , 421098 );
70
+
78
71
fp = fopen (" /wlan/cacert.pem" , " wb" );
79
72
ret = fwrite (cacert_pem, cacert_pem_len, 1 , fp);
80
73
fclose (fp);
@@ -94,4 +87,4 @@ void setup() {
94
87
95
88
void loop () {
96
89
97
- }
90
+ }
0 commit comments