File System: Getting Started

Basic Steps

Basic Concepts

Client Context

You must create at least one FS client to access the file system. When FSAddClient is called, a context is created in FS and a handle is returned. You can register up to 64 clients. This context includes:

The "FS client handle" is common to FS. An application can have up to 64 FS client handles in total.

Command Block

Almost all FS functions have a command block argument. A function uses this command block memory to create a queue in FS, infinite command queues are implemented.

Also, you can cancel a function before processing by specifying a client and/or command block.

The command block has to be initialized once prior to the availability of the block. The block must not be freed until the end of the FS function after the function is called with the command block.

FSCmdBlock cannot be used for multiple commands at the same time. While calling an API with FSCmdBlock, the FSCmdBlock cannot be used to call another API. You must use another FSCmdBlock to call the secondary API, or wait for the FSCmdBlock to no longer be in use and not in exclusive control.

Times during which FSCmdBlock is "in use" are defined as follows:

In case of an asynchronous API, once the completion notice arrives, FSCmdBlock becomes no longer in use. The exact FSCmdBlock can be used to call the next asynchronous API within the completion callback. See fs_read_async demo for this usage.

Data Buffer Alignment

Of critical importance are the alignment requirements for read and write data buffers. Both the CPU and device-specific alignment requirements must be satisfied for all FS data transactions.

The CPU alignment specification is defined by the FS_IO_BUFFER_ALIGN macro. Both buffer address and size must be aligned by this value.


For more information, see the file and directory access demos.

See Also

File System Overview : Introduction

Revision History

2013/05/08 Automated cleanup pass.
2012/07/27 Removed information about FSA.
2012/05/18 Revised descriptions of command block usage.
2012/04/04 Initial version.