File System Component  Version 6.6
MDK-Professional Middleware for Devices with Flash File System
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
File System Examples

The File System Component is used in many different applications and examples. One stand-alone example is available to demonstrate the usage of the File System. Other examples use the File System Component in conjunction with other Components (such as USB or Network for example).

To use these examples, use the Pack Installer, select the related Board and Copy the example.

File System Example

This example shows how to manipulate files on a given drive using the File System Component. You can create, read, copy and delete files on any enabled drive (memory Card, NOR/NAND Flash) and format each drive. To keep it simple, the Debug (printf) Viewer in MDK is used to interact with the storage devices. The online help explains how to connect your stdio to the Debug (printf) Viewer window. The following picture shows an exemplary connection of the development board and a Computer:

fs_setup.png

The Abstract.txt file contained in the Documentation group of the Project window gives you more information on the general setup and the available I/O of the development board.

Build the "File System" Project

Open the example project in MDK (the Pack Installer's web page explains how to do this). The µVision Project window should display a similar project structure:

fs_proj_structure.png
File System Project Structure

Source Files

  • File_Demo.c contains the main C function that initializes the board hardware and the File System Component. It also defines the functions for the accessing the data on the hardware.
  • The Getline.c file contains the function for getting formatted input from stdio.

You may now build and download the example project to the evaluation board using the µVision commands:

  • Project –> Build target
  • Flash –> Download

After these steps, the project should start executing on your evaluation kit. In case of errors, refer to the Evaluation Board User's Guide for configuration information.

Using the "File System" Project

Hardware Setup

The setup of the Evaluation Board hardware is described in the Abstract.txt file.

  • Verify all jumper settings on the target hardware.
  • Connect all supported devices to the development board (for example SD card).
  • You need to have a ULINK connection to the development board as the command line is sent to the Debug (printf) Viewer window of an active Debug session.

PC Software

After building the program, download the code into Flash and start a Debug session. Open the Debug (printf) Viewer window and start the code execution by either pressing F5 or using the Run button. You should now see something similar like this:

fs_printf.png