1

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);
}
asked May 13, 2023 at 1:07
1
  • which code are you talking about? ... please add the program listing to your question Commented May 13, 2023 at 16:29

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.