Example FreeRTOS-Plus-FAT SL Project
For the FreeRTOS Win32 Simulator (and other hardware platforms)
FreeRTOS-Plus-FAT is also demonstrated using the same functionality as
described on this page in the following RTOS demo applications:
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
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.
The project is pre-configured to build with the
free Express edition of Microsoft Visual C++
(MSVC). MSVC Express Edition 2010 was used.
The demo:
-
Creates and formats
a RAM disk using the standard
media driver API.
-
Uses f_write()
to create a set of example files in the root directory of the RAM disk.
-
Uses f_read()
to read the files that were created in the root directory.
-
Uses f_mkdir()
to create two sub directories, and
f_chdir() to
move into the created subdirectory.
-
Uses f_putc()
to create a file one character at a time.
-
Uses f_getc()
to read back a file one character at a time.
-
Create a command console (using
FreeRTOS-Plus-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]
|
The command console is accessed from a UDP terminal.
See the
Usage Instructions section below.
-
The demo application is available in the main
FreeRTOS .zip file download.
-
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.
-
Select "Build Solution" from the IDE's Build menu (or press F7)
to build the application.
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.
-
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 in the Windows console when the demo application starts
-
This demo connects to the FreeRTOS-Plus-CLI command line interface though a UDP port.
The Windows TCP/IP stack is used instead of FreeRTOS-Plus-UDP to ensure
this demo remains focused on the file system. A demo application
that uses the FreeRTOS Windows simulator and FreeRTOS-Plus-UDP to create
a command console is available in the FreeRTOS-Plus-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-Plus-CLI listens for characters
arriving on UDP port 5001 and sends its output to UDP port 5002.
The required terminal configuration is shown below.
Configuring the YAT terminal to communication with the
FreeRTOS-Plus-CLI command line interface
-
As always with FreeRTOS-Plus-CLI, type "help" to see a list of
registered commands.
Type "help" in the UDP terminal to see a list of registered commands
-
Experiment with the file system commands! A sample session is shown below.
Running FreeRTOS file system commands in the YAT terminal
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.