FreeRTOS+FAT File System with no FTP/HTTP Server, Only SD Card

Hello everyone! Quick and maybe weird question: Is it possible to create a FAT System with the FreeRTOS+FAT that runs entirely on the microcontroller (NO FTP/HTTP SERVERS!) and stores everything in an SD Card? I am completely new to File Systems and couldn’t find any example of the FreeRTOS+FAT that uses only an SD Cardto store/retrieve data; they all ended up including FTP/HTTP. I require this because I want to test a serializer/deserializer to configure the microcontroller on real time, but parting from files that are stored in an SD card only (no IP Adressing in this project YET!!!) If it is possible, I would like to know which libraries would be necessary to include (either that or a yes or no answer for if it is possible would be cool!) If not possible, I would like to know why (as I said, new to file systems). Thank you in advance! -Oscar

FreeRTOS+FAT File System with no FTP/HTTP Server, Only SD Card

Hola Oscar,
Is it possible to create a FAT System with the FreeRTOS+FAT that runs entirely on the microcontroller (NO FTP/HTTP SERVERS!)
Sure that is possible. You will only have to include the +FAT sources, along with the appropriate +FAT driver. And then you can access an SD-card by using the pseudo stdio functions, as defined in “ff_stdio.h”. If you like, it is also possible to create a RAM disk.

FreeRTOS+FAT File System with no FTP/HTTP Server, Only SD Card

Sorry, I didn’t answer all of your questions:
I would like to know which libraries would be necessary to include
Depending on the platform: ~~~ FreeRTOS-Plus-FATportableSTM32F4xxffsddisk.c FreeRTOS-Plus-FATportableSTM32F4xxstm32f4xxhal_sd.c FreeRTOS-Plus-FATportableSTM32F7xxffsddisk.c FreeRTOS-Plus-FATportableSTM32F7xxstm32f7xxhal_sd.c FreeRTOS-Plus-FATportablelpc18xxff_sddisk.c FreeRTOS-Plus-FATportableATSAM4Eff_sddisk.c ~~~ Remember, if you have to store loads of data, try to cache the data in buffers and write them to the SD-card in multiples of at least 512 bytes. The bigger the write blocks, the faster data will be written. If you’re only writing a few bytes, you can as well use a formatting ff_printf().

FreeRTOS+FAT File System with no FTP/HTTP Server, Only SD Card

Thank you very much Hein! Necessary libraries are a great starting point but I had lots of problems understanding which ones were necessary. I will try to implement it now! Thanks again! -Oscar

FreeRTOS+FAT File System with no FTP/HTTP Server, Only SD Card

Thank you very much Hein! Necessary libraries are a great starting point but I had lots of problems understanding which ones were necessary. I will try to implement it now! Thanks again! -Oscar

FreeRTOS+FAT File System with no FTP/HTTP Server, Only SD Card

Hello Hein, I have yet another weird doubt:
Depending on the platform:
FreeRTOS-Plus-FATportableSTM32F4xxffsddisk.c FreeRTOS-Plus-FATportableSTM32F4xxstm32f4xxhal_sd.c
>FreeRTOS-Plus-FATportableSTM32F7xxff_sddisk.c
FreeRTOS-Plus-FATportableSTM32F7xxstm32f7xx_hal_sd.c

>FreeRTOS-Plus-FATportablelpc18xxff_sddisk.c
** FreeRTOS-Plus-FATportableATSAM4Eff_sddisk.c**
I am using an ATSAM3X8C as a controller; so I tried, to see if it worked, using the ff_sddisk.c file within the ATSAM4E folder, but I’m having lots of problems when trying to compile my code like that. Do you know if, or what would you suggest is the best course of action from these: a) It should work like that, as the SAM microcontrollers are similar for SD card connections and I’m probably just having problems including the files, in which case I just need to correct the errors… although I’ve been at it since yesterday… OR b) It should NOT work as the functions needed for SD card connections are really different from the SAM3X8C to the SAM4E, in which case I should implement my own ff_sddisk.c application for the SAM3X8C. Thank you in advance for any suggestion and your response. Kind regards,
Oscar

FreeRTOS+FAT File System with no FTP/HTTP Server, Only SD Card

Hi Oscar, The source file ATSAM4Eff_sddisk.c should be a good basis for any other Atmel controller. But you will have to merge it with the low-level driver that is available for your ATSAM3X8C. The most important functions of any ff_sddisk.c are these : ~~~ 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 ) ~~~ And the initialisation is also pretty generic: ~~~ FFDiskt *FF_SDDiskInit( const char *pcName ) ~~~ It creates a FF_Disk_t with an I/O manager ( pxDisk->pxIOManager ). If you find it complicated, you can write me directly to: hein [at] htibosch [point] net That will be quicker rather than writing many posts about boring details.