Skip to main content
Visitor II
December 18, 2019
Question

Hi, I am using fatfs on flash along with usb msc device on stm32 mcu ,it is working usb detected I am able to do file operations and check files from desktop when plugged in the usb.

  • December 18, 2019
  • 1 reply
  • 603 views

what i noticed is if i create n no of files, only 8 files are displayed however the remaining files are also created but not displayed, i am using elm chans fatfs. What could be the problem

why only first 8 files displayed on pc .Kindly let me know a solution for this problem.

f_mount(&USERFatFS,"",0);

f_open(&USERFile,"file1.TXT",FA_CREATE_NEW | FA_WRITE|FA_READ);

for(int i = 0 ; i< 10;i++)

f_printf(&USERFile, "%s","hello");

f_close(&USERFile);

f_mount(&USERFatFS,"",0);

f_open(&USERFile,"file2.TXT",FA_CREATE_NEW | FA_WRITE|FA_READ);

for(int i = 0 ; i< 10;i++)

f_printf(&USERFile, "%s","hello");

f_close(&USERFile);

f_mount(&USERFatFS,"",0);

f_open(&USERFile,"file3.TXT",FA_CREATE_NEW | FA_WRITE|FA_READ);

for(int i = 0 ; i< 10;i++)

f_printf(&USERFile, "%s","hello");

f_close(&USERFile);

f_mount(&USERFatFS,"",0);

f_open(&USERFile,"file4.TXT",FA_CREATE_NEW | FA_WRITE|FA_READ);

for(int i = 0 ; i< 10;i++)

f_printf(&USERFile, "%s","hello");

f_close(&USERFile);

.

.

.

.

file10.TXT

only files 1 to 8 detected on pc .

Thanks in advance.

    This topic has been closed for replies.

    1 reply

    Visitor II
    December 18, 2019

    I suspect that the directory entries are not updated on the drive immediately. Try unmounting the drive after closing the last file.

    f_mount(0,"",0);

    sviiAuthor
    Visitor II
    December 18, 2019

    Hi , thanks for the reply i even tried unmounting the drive using f_mount(0,"",0); after every f_close , the problem still persists. The files are not detected by

    desktop.