Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Homepage FreeRTOS+ Products FreeRTOS Labs Integration Services Contact / Enquiries

Example FreeRTOS+FAT SL Project
For the FreeRTOS Win32 Simulator (and other hardware platforms)


FreeRTOS+FAT is also demonstrated using the same functionality as described on this page in the following RTOS demo applications:

On this page:



Source Code and Project Files

The project described on this page is located in the following folder of the main FreeRTOS .zip file download:
FreeRTOS-Plus/Demo/FreeRTOS_Plus_FAT_SL_and_CLI_Windows_Simulator


Target Hardware

The project creates a RAM disk using the FreeRTOS Windows simulator. The Windows simulator provides a convenient evaluation platform, but it does not exhibit real time behaviour. Simulated time is much slower than real time.


Compiler / Tool Chain

The project is pre-configured to build with the free Express edition of Microsoft Visual C++ (MSVC). MSVC Express Edition 2010 was used.


Functionality

The demo:
  1. Creates and formats a RAM disk using the standard media driver API.
  2. Uses f_write() to create a set of example files in the root directory of the RAM disk.
  3. Uses f_read() to read the files that were created in the root directory.
  4. Uses f_mkdir() to create two sub directories, and f_chdir() to move into the created subdirectory.
  5. Uses f_putc() to create a file one character at a time.
  6. Uses f_getc() to read back a file one character at a time.
  7. Create a command console (using FreeRTOS+CLI) that implements the following file system related commands:

    Command and parameters Description
    dir Lists the name, size and attributes of the files in the current working directory.
    cd [dir name] Sets the current working directory to [dir name]
    type [filename] Prints the contents of [filename] to the command console window
    del [filename] Deletes [filename]
    copy [source file] [destination file]   Creates a duplicate of [source file] named [destination file]


Command Console Input and Output

The command console is accessed from a UDP terminal. See the Usage Instructions section below.


Build Instructions

  1. The demo application is available in the main FreeRTOS .zip file download.

  2. Open the Visual Studio solution file FreeRTOS_Plus_FAT_SL_with_CLI.sln from within the Visual Studio IDE. The solution file is located in the "FreeRTOS-Plus/Demo/FreeRTOS_Plus_FAT_SL_and_CLI_Windows_Simulator" directory.

  3. Select "Build Solution" from the IDE's Build menu (or press F7) to build the application.


Debug Instructions

The standard Visual Studio key used to start a debug session and break on entry to main() is F10.

The same host computer is used to build the application, debug the application, and (because the FreeRTOS Win32 simulator is used) run the application. There are no special debugging instructions.


Usage Instructions

  1. The demo application creates a set of files and directories on a RAM disk. Information messages generated during this process are output to the Windows console. This allows this portion of the demo application to be used without a command console.

    The output generated when the FAT file system files and directories are created
    The output generated in the Windows console when the demo application starts


  2. This demo connects to the FreeRTOS+CLI command line interface though a UDP port. The Windows TCP/IP stack is used instead of FreeRTOS+UDP to ensure this demo remains focused on the file system. A demo application that uses the FreeRTOS Windows simulator and FreeRTOS+UDP to create a command console is available in the FreeRTOS+UDP section of this website.

    Free dumb terminal programs that are suitable for connecting to the command line interface using UDP include YAT and Hercules.

    The standard localhost IP address (127.0.0.1) can be used because both the (simulated) demo application and the UDP terminal execute on the same computer. FreeRTOS+CLI listens for characters arriving on UDP port 5001 and sends its output to UDP port 5002. The required terminal configuration is shown below.

    Settings required to communicate with the RTOS command line
    Configuring the YAT terminal to communication with the FreeRTOS+CLI command line interface


  3. As always with FreeRTOS+CLI, type "help" to see a list of registered commands.

    Viewing the file system file related RTOS commands
    Type "help" in the UDP terminal to see a list of registered commands


  4. Experiment with the file system commands! A sample session is shown below.

    running the file system RTOS commands
    Running FreeRTOS file system commands in the YAT terminal



[ Back to the top ]    [ About FreeRTOS ]    [ FreeRTOS+ Sitemap ]    [ Main FreeRTOS Sitemap ]    [ ]


Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.