I am attaching an example that I have worked out for Atmel Cortex-M SAM4 micro-controller. The example is based on FreeRTOS+FAT-SL but instead of using RAM as a storage area, I have used an SD card. Please check the attached Atmel Studio Solution. Please remove part of the code that is not necessary such as FreeRTOS blinking task and UART configuration. The platform that I am using is SAM4S-EK2 board from Atmel. Feedback is greatly appreciated.
SAM4S-EK C Ex.zip