5 years, 7 months ago.

Update

Hello, I update my 2 years a go project. Inside of the projekt is the FATFileSystem. When i make a update on the mbed icon I can not compile the main.c. The error is in the fatfilesystem.cpp. What can I do? Bernd

2 Answers

5 years, 7 months ago.

Thanks to the author of the previous post. It's good when the administration answers. Nevertheless, I would like to write about app review service where you can order an excellent service, as well as find a lot of useful things about the mobile industry in their blog. I know from personal experience, because I used both.

5 years, 7 months ago.

Hi Bernd,

Can you please post your code so we can decipher where you need to update the API calls to the FATFileSystem? Here's also the latest documentation for FATFileSystem on Mbed OS 5: https://os.mbed.com/docs/latest/apis/fatfilesystem.html

And here's information on how to migrate an Mbed OS 2 project to Mbed OS 5 (if your project is currently using Mbed OS 2): https://os.mbed.com/docs/latest/tutorials/migrating-to-mbed-os-5.html

Thanks!

- Jenny, team Mbed

hello jenny, thanks for you help. How can I send you the exported project? The error occurs here >>>:

FileHandle *FATFileSystem::open(const char* name, int flags) {
    FFSDEBUG("open(%s) on filesystem [%s], drv [%d]\n", name, _name, _fsid);
    char n[64];
    sprintf(n, "%d:/%s", _fsid, name);

    /* POSIX flags -> FatFS open mode */
    BYTE openmode;
    if(flags & O_RDWR) {
        openmode = FA_READ|FA_WRITE;
    } else if(flags & O_WRONLY) {
        openmode = FA_WRITE;
    } else {
        openmode = FA_READ;
    }
    if(flags & O_CREAT) {
        if(flags & O_TRUNC) {
            openmode |= FA_CREATE_ALWAYS;
        } else {
            openmode |= FA_OPEN_ALWAYS;
        }
    }

    FIL fh;
    FRESULT res = f_open(&fh, n, openmode);
    if(res) { 
        FFSDEBUG("f_open('w') failed (%d, %s)\n", res, FR_ERRORS[res]);
        return NULL;
    }
    if(flags & O_APPEND) 
    {
        f_lseek(&fh, fh.fsize);
    }
 >>>>   return new FATFileHandle(fh);
}

The error message is: Warning: Overloaded function "mbed::FileSystemHandle::open" is hidden by "mbed::FATFileSystem::open" -- virtual function override intended? in "FatFileSystem/FATFileSystem.h", Line: 40, Col: 26

I do not understand this excuse my stupid questions. a other problem is, I build some datalogger and store the data on the usb stick, some times the system lost data on the stick. The datarate is 6144 Bytes write as a block every second for 48 hours.... Bernd

posted by Bernd Boemer 28 Sep 2018