I want to implement FAT32 on FreeRTOS for USB OTG USB Memory.

Hi everyone. I want to implement FAT32 on FreeRTOS for USB OTG USB Memory. In my information, FreeRTOS have provided FAT32 with FreeRTOS Source Code. But it is only for RAM Media FAT32 not Flash Media FAT32. How to implement FAT32 for Flash Media? Thank advance. Kevin

I want to implement FAT32 on FreeRTOS for USB OTG USB Memory.

Just as TCP code is generic, but must be ported to an Ethernet controller, the FAT code is generic, but must be ported to the media that is going to store the file file system. Information on how to do this is provided on the following link: http://www.freertos.org/FreeRTOS-Plus/FreeRTOSPlusFAT/Creatingafilesystemmedia_driver.html

I want to implement FAT32 on FreeRTOS for USB OTG USB Memory.

Below is SD Disk API from FreeRTOS. Can i use below for USB Stick like “FF_USBDiskDetect() with just porting for reading, writing, IOMan Initializing and DISK IO “? BaseTypet FFSDDiskDetect( FFDiskt *pxDisk ); FF_Disk_t *FF_SDDiskInit( const char *pcName ); BaseType_t FF_SDDiskReinit( FF_Disk_t *pxDisk ); BaseType_t FF_SDDiskUnmount( FF_Disk_t *pDisk ); BaseType_t FF_SDDiskMount( FF_Disk_t *pDisk ); BaseType_t FF_SDDiskDelete( FF_Disk_t *pDisk ); BaseType_t FF_SDDiskShowPartition( FF_Disk_t *pDisk ); void FF_SDDiskFlush( FF_Disk_t *pDisk ); BaseType_t FF_SDDiskFormat( FF_Disk_t *pxDisk, BaseType_t aPart ); BaseType_t FF_SDDiskInserted( BaseType_t xDriveNr ); FF_IOManager_t *sddisk_ioman( FF_Disk_t *pxDisk ); Thank you Kevin.

I want to implement FAT32 on FreeRTOS for USB OTG USB Memory.

I’m not sure I fully understand your question, but yes, you should be able to port to USB storage. It may be a little trickier than most port as you will need to start with a working USB stack with appropriate drivers.

I want to implement FAT32 on FreeRTOS for USB OTG USB Memory.

I think that the documentation pointed-out by Richard is quite complete. But the most important functions to be implemented are: ~~~ static int32t prvFFRead( uint8t *pucBuffer, uint32_t ulSectorNumber, uint32_t ulSectorCount, FF_Disk_t *pxDisk ); static int32_t prvFFWrite( uint8_t *pucBuffer, uint32_t ulSectorNumber, uint32_t ulSectorCount, FF_Disk_t *pxDisk ); ~~~ You’ll bind the address of these functions to the so-called io-handler. Note that these functions use sector numbers, not a byte offset. For the other FF_SDDisk functions you can use the existing implementation in most cases.