4 years, 10 months ago.

USB Stockage with mbed-os 5

Hi I have an issue. I was using a code to stock on an USB, it was working fine until I updated it to mbed-os the code I was using is :

#include "mbed.h"
#include "MSCFileSystem.h"
 
MSCFileSystem fs("fs");
DigitalOut led(LED1);
AnalogIn pot1(p19);
 
int main()
{
    FILE *fp = fopen("/fs/test.csv","w");
    printf("Create filehandle for test.csv\n");
 
    printf("Writing to file\n");
    for (int i=0; i<100; i++)  {
        fprintf(fp,"%.2f\n",pot1.read());
        wait(0.05);
        led=!led;
    }
 
    fclose(fp);
    printf("Close the handle\n");
    led=1;
}

when I updated this code to work on the OS 5, it looks like the "MSCFileSystem.h" doesn't work anymore. is there any solution to make the USB flash working on mbed-os 5

Be the first to answer this question.