File tree Expand file tree Collapse file tree 3 files changed +23
-10
lines changed
Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Original file line number Diff line number Diff line change 99#define FULL_UPDATE_FILE_PATH " /" SD_MOUNT_PATH " /" MBED_CONF_APP_UPDATE_FILE
1010
1111#define POST_APPLICATION_ADDR 0x10000
12+ #define VERSION 1
1213
1314#if !defined(POST_APPLICATION_ADDR)
1415#error "target.restrict_size must be set for your target in mbed_app.json"
1516#endif
1617
1718// Pin order: MOSI, MISO, SCK, CS
18- // FlashIAPBlockDevice sd(XIP_BASE + 0xF00000, 0x100000);
19- FlashIAPBlockDevice sd (XIP_BASE + 0x100000 , 0x100000 );
19+ FlashIAPBlockDevice sd (XIP_BASE + 0xF00000 , 0x100000 );
20+ // FlashIAPBlockDevice sd(XIP_BASE + 0x100000, 0x100000);
2021FATFileSystem fs (SD_MOUNT_PATH);
2122FlashIAP flash;
2223
Original file line number Diff line number Diff line change 1- https://github.com/arduino/mbed-os/#1820aade78cbc3e3231def2c3ffd0b363bf1778c
1+ https://github.com/arduino/mbed-os/#45445a4b76d8d05d6083f8bf481e5b4efe7bf1c7
Original file line number Diff line number Diff line change 11#include " SFU.h"
22#include " FlashIAPBlockDevice.h"
33#include " FATFileSystem.h"
4- // #include "PluggableUSBMSD.h"
4+ #include " PluggableUSBMSD.h"
55
66const unsigned char SFU[0x10000 ] __attribute__ ((section(" .second_stage_ota" ), used)) = {
77 #include " rp2040.h"
88};
99
10- FlashIAPBlockDevice bd (XIP_BASE + 0x100000 , 0x100000 );
11- static mbed::FATFileSystem fs (" ota" );
10+ FlashIAPBlockDevice bd (XIP_BASE + 0xF00000 , 0x100000 );
1211
13- int SFU::begin () {
14- int err = fs.mount (&bd);
15- if (err) {
16- err = fs.reformat (&bd);
12+ void USBMSD::begin ()
13+ {
14+ int err = getFileSystem ().mount (&bd);
15+ if (err) {
16+ err = getFileSystem ().reformat (&bd);
1717 }
1818}
1919
20+ mbed::FATFileSystem& USBMSD::getFileSystem ()
21+ {
22+ static mbed::FATFileSystem fs (" ota" );
23+ return fs;
24+ }
25+
26+ USBMSD MassStorage (&bd);
27+
28+ int SFU::begin () {
29+ MassStorage.begin ();
30+ }
31+
2032int SFU::download (const char * url) {
2133 // No download at the moment, allow the user to upload a file via mass storage
2234}
You can’t perform that action at this time.
0 commit comments