Multi-tasking FAT Filesystem for FreeRTOS.

Dear All, I have ported the FreeRTOS on our proprietary DSP core. Also ported an open source FAT File system and its working fine with my SD card driver. http://elm-chan.org/fsw/ff/00index_e.html But FATFS do not support multitasking environment. FATFS Application note says that “Porting to RTOS-When use FatFs module from only one task, no consideration is needed. However when make access to a logical drive from two or more tasks simultaneously, any exclusion control will be required.” Even after doing the semaphore control using mutex, I could not access multiple files from different tasks. Example: File-A is opened in Task-A and doing some operation on it (f_lseek),          simultaneously I can not access to the file pointer of File-B in Task-B. Do you have any suggestions on this? Have anyone of you ported FATFS or any other File system for FreeRTOS and working in multitasking environment? My target:            A: Audio files playing with audio decoder in Task-A.            B: JPG files displaying with JPG decoder in Task-B.           TIA. Regards, Prithwee.

Multi-tasking FAT Filesystem for FreeRTOS.

go to http://www.jcwren.com/arm/

Multi-tasking FAT Filesystem for FreeRTOS.

Yes, that was a good referance for my project. Thnak you. But my actual problem lies in the implementation of FATFS for RTOS. http://elm-chan.org/fsw/ff/en/appnote.html -->Problems and Ideas–>Porting to RTOS. Because of this shared resource filesystem, after mutex locking am not able to access the 2nd file on a 2nd Task while 1st file on 1st task is already open. It will give the access to the 2nd file only after 1st file will be operated with "f_close". Any solution to do operation on both the files simaltanously on differnt tasks? TIA.  Regards, Prithwee.

Multi-tasking FAT Filesystem for FreeRTOS.

From your description the 1st task is not releasing the mutex between file accesses, so the 2nd task is always blocked while waiting for the mutex.  Either release the mutex between file system calls or implement the file system as a separate task and send filesystem requests to the FS task in a queue, which will serialize access to the resource, replacing the mutex.

Multi-tasking FAT Filesystem for FreeRTOS.

Hi, I´ve used the Chan´s FAT implementation for FAT filesystems (FATTF) succesfully with Freertos. This FAT driver only need the diskio implementation for your device (SD, MMC, NANDFlash etc), so in my case I developed an SD driver with SPI handling. In my SPI driver I use FreeRTOS, so Chan´s Fat becomes FreeRTOS enabled (thread safe). You can see the code in this forum (in spanish but the code is english commented). http://www.sistemasembebidos.com.ar/forum/index.php?topic=730.0 Also I place it in google code: http://code.google.com/p/sistemasembebidos/ With a AT91SAM7S at 47.9 Mhz I get 370Kbytes/sec for read and write files (maybe because I use old MMCs…) Regards!

Multi-tasking FAT Filesystem for FreeRTOS.

Sorry for the misspell I mean FATFS

Multi-tasking FAT Filesystem for FreeRTOS.

Hi darukur, Can you access your sd-card READ/WRITE simaltanously from different tasks? Your example code shows copy operation in a single task-vFatFsDemo. How about "READ" in Task-A and Write in Task-B? Did you consider the Re-Entrant functionality and resource locking for FATFS? Regards, Prithwee.