I see that they arduino nano ble 33 support USB 2.0. Is there a way for us to create a USB mass storage of about 200kb for convenient storage of configuration files and history files? I see example arduino has UsbMassStorage but by default it only creates 1 disk with 512KB capacity. Which 512KB + 200KB bootloader is my chip error. Is there a way to reconfigure the capacity for UsbMassStorage? Thank you so much.
/*
This example exposes the second half (512KB) of Nano 33 BLE flash
as a USB disk.
The user can interact with this disk as a bidirectional communication with the board
For example, the board could save data in a file to be retrieved later with a drag and drop
*/
#include "PluggableUSBMSD.h"
void setup() {
Serial.begin(115200);
MassStorage.begin();
// write a file with some data
// a+ means append, so every time the board is rebooted the file will grow by a new line
FILE *f = fopen("/fs/data.txt", "a+");
String hello = "Hello from Nano33BLE Filesystem\n";
fwrite(hello.c_str(), hello.length(), 1, f);
fclose(f);
}
void loop() {
delay(1000);
}