This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 SDK16 - USB MSC Example - What is happenning when the external flash memory get full?

Hi everyone,

I am using the nRF52840 DK and I am experimenting with the USB MSC example. My purpose is to record data from an IMU device and store them in files. Then to read the files and transmit the data over bluetooth to the central.

I have two questions

1. Is there any limitation regarding the file size?

2. What is happening when the memory is getting full?

Thanks in advance

Nick

Parents Reply
  • Hi Nikos

    I did some testing to see what would happen, and it seems you don't get an error, but you will see that you are not able to write more bytes into the file. 

    UINT buffer_length = 64;
    UINT bytes_written;
    ff_result = f_write(&file, data_write_buffer, buffer_length, &bytes_written);
    if(bytes_written < buffer_length || ff_result != FR_OK)
    {
        NRF_LOG_ERROR("File write error: bytes %i, result %i");
    }

    If the f_write function reports less bytes written than you ask for it means there is no more room for data on the drive. 

    Best regards
    Torbjørn

Children
Related