Just like title show.
I just want to use FATFS_0.09 run together with rl_usb (not RL_FLASHFS).
any ideas?
or RL_FLASHFS support chinese file names??
Another question, how do I know the current USB is busy in RL_USB?
BYTE USB_disk_read ( BYTE *buff, /* Data buffer to store read data */ DWORD sector, /* Sector address (LBA) */ BYTE count /* Number of sectors to read (1..128) */ ) { if(!count) { return RES_PARERR; } printf("secotor:%d\tcount:%d\r\n",sector,count); return (usbh_msc_read(0, 0, sector, buff, count)); }
When I try to read data (more than one time) error happening.
I think that is because USB in busying status. right?
> When I try to read data (more than one time) error happening. > I think that is because USB in busying status. right?
No, usbh_msc_read() is a synchronous function. It doesn't return until the read operation finishes, or until some "physical" error occurs. Sound like the cause lives in elsewhere.
Did you mount two drives simultaneously? Then, assign dedicated FATFS structure to each drive.
static FATFS sFatFs0, sFatFs1; f_mount( 0, &sFatFs0 ); f_mount( 1, &sFatFs1 );
If you would open two files together, assign dedicated FIL structure to each file.
static FIL fileObj0, fileObj1; f_open( &fileObj0, "src.txt", FA_READ ); f_open( &fileObj1, "dst.txt", FA_WRITE );
Tsuneo
Thanks Tsuneo!^_^
system work well now! As you said!
other question!
(my project is STM32F207 WITH RL_USB + FATFS)
can usb host (MSD project) read data from hard disk ( two or more logical partition)?
set _MULTI_PARTITION == 0, just can read data from hard disk in main partition.
set _MULTI_PARTITION == 1, use f_open to read a file, return error code
FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */
my open file function is
res = f_open(&fsrc, "2:/STM32.TXT", FA_OPEN_EXISTING | FA_READ);
more ideas for _MULTI_PARTITION == 1??
You do know that FatFS has an online user manual, right? I used it extensively, and guess what I did not forget to mount my drives....