File System Component  Version 6.16.6
MDK Middleware for Devices with Flash File System
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).

  • The File System Example shows the basic functionality of the File System.
  • The shows how to create an USB MSC Device that is recognized by an USB Host controller.
  • The explains how to access file system data from an attached USB memory device.
  • The accesses the device's file system via a network connection.

These examples are available through the ; 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 in MDK interacts and connect with the storage devices and your stdio. The following picture shows an exemplary connection of the development board and a computer:

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 web page explains how to do this). The ┬ÁVision Project window should display a similar project structure:

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: