cancel
Showing results for 
Search instead for 
Did you mean: 

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.

svii
Associate III

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.

2 REPLIES 2
berendi
Principal

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);

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.