Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Integrating a file system

Posted by Colin Stanley on December 6, 2006
I'm looking for a few pointers or suggestions on the best way to implement a file system to Freertos. I have version 4.1.3 successfully running with the lwip stack on an AT91SAM7X board. All works well. I've ported over the EFSL FAT library, and all seems to work well with flash cards over SPI in a stand alone mode. My questions is how to best integrate this within the OS. I can see several ways to go about this, but is there a prefered or recommended method. Should the file system be a separate task, or a shared resource (in which case anyone know if EFSL is reentrant?). Since I would like any running task to access a file, I assume there should be some type of queue on requests to open files. Then on the back end the file system needs to wait for the SPI DMA to complete, is this best done with semaphores or another queue?. Anyone have any thoughts or pointers or been down this path before.


RE: Integrating a file system

Posted by Nobody/Anonymous on December 6, 2006
I think it depends a lot on whether or not your file system (EFSL) is designed to be re entrant or not. If you opened two files from two different tasks causes it to corrupt, then you are going to need some form of gate keeper task - a task that handles all file IO. The implementation of this in turn depends on whether your application requires blocking reads and writes.

The ideal solution would be to have the mutual exclusion only around access to the hardware. For example the SPI bus if using an SD card. And have the rest of the code re entrant. Then only blocks occur when accessing the actual hardware.

RE: Integrating a file system

Posted by Jokke on January 9, 2007
I am using FreeRTOS and efsl on a relatively small (1 MB) SPI flash for some time, with the following experience:
-I use a semaphore to make sure only one is using the file system at a time. The efsl functions are not reentrant.
-I suspect there are problems keeping files open and letting others access the file system. I am not sure about this, but until now I always close a file before leaving the semaphore. I would be interested in other experiences around this.
-It looks like development has stopped for this fs? Very little activity on their forum and home page. Does anyone know another good file system?



[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.1 is available for immediate download. MIT licensed, includes 64-bit RISC-V, NXP Cortex-M33 demo & Nuvoton Cortex-M23 demo.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner