HCC-Embedded Tiny FS
Local Menu
IXXAT Platinum Partner
You are here: ".$breadcrumb->show_breadcrumb().""; ?>

TINY File System

for flash devices with small erasable sector

TINY is a failsafe file system designed for any flash device with small erasable sectors. Ideal for most standard serial flash parts, Flash based Micros with small erasable sectors (e.g. MSP430) and RAM drives.

TINY can be tested on the: uCDrive Development Board with a variety of different flash memory modules

TINY is designed for the easy integration and configuration of new chip types. HCC gives free consultancy for adding new device types or modifying existing ones. Also available is hardware reference design information.

Rationale

Flash technology is constantly changing and comes in many variants. To get the most from any particular flash arrangement file systems need to be crafted. TINY is crafted to work with flash which has small erasable sectors with the specific design goals of being failsafe, having small ROM footprint and minimal RAM footprint - making it possible to use with very small microcontrollers.

Traditionally most flash devices have had very large erasable sectors (typically 32K or greater) which always leads to fragmentation issues when creating a file system. By designing TINY so that it is "configured into" a particular flash it allows the developer to set file system to meet their file requirements with minimal resource usage.

Additonally, when used with uCDrive technology, your microcontroller becomes a fully configurable and manageable pen drive with minimal overhead.

Microcontrollers, such as the MSP430Fxxx series, have included flash which is both erasable in small sectors and is application programmable. When used with TINY new possibilities arise such as being able to store all your configuration files as standard .ini or .txt files; or being able to just drop a new wav file to the microcontroller without having to worry about flash layout and fragmentation issues.

Additionally there are many standalone flash devices (and particularly serial flash devices) which have relatively small erasable sector sizes and therefore can benfit from a file system crafted to their arrangement.

Standard NOR flash devices also had the drawback of very long erase times - often greater than 1 second - whereas these smaller erasable sector devices have much reduced erase times - typically a few milliseconds. This factor also gives new design possibilities to microcontroller based products requiring some kind of flexible storage.

Traditionally microcontroller developers have not used file systems because of the overheads involved - now it is possible for developers to get the benefits of position independent storage together with exellent footprint and performance characteristics which opens up new possibilities for the configuration and management of microcontroller based products

Power-Fail

SAFE is a 100% powerfail safe system.
Why is it needed?

Embedded devices do not have the luxury of sophisticated disk recovery programs as PC comaptible devices do. If your embedded devices file system gets corrupted because an erase or write operation is unexpectedly terminated what will happen to the system - lost sectors? - lost the whole device? - how do you repair it? Robust is not enough in many cases - the system should be designed to restore your file system from whatever point it failed. This is TINY file system!!

How is it done?

The basic method of operation is quite simple - a complete new file system must be available for use before any information is erased. In this way, if the worst happens the system can be rebuilt either in its pre-write form (as if the write had never started) or with the new modifications included. This is not possible to guarantee with a DOS compatible file system (hence the prevalence of disk recovery software) and with many other file systems.

While the concept is relatively simple an efficient implementation with flash devices which require sectors to be erased before writing is definitely complex. Write and erase times can be relatively long on flash devices and it is extremely important to ensure the number of these operations is minimised. We believe our write/erase performance per sector written is second to none for a 100% power-fail system and indeed with systems that are not power-fail safe.

How is it Verified?

The main method of verification is through PC simulation of the file system where thousands of test cases can be run relatively easily - running the standard source code with simulated NOR and/or NAND flash devices. The code is then stopped at random or at selected points and it is checked that the system reliably restarts and that no data is lost.

Further testing has been done with real NOR and NAND flash arrays by repeatedly breakpointing the code at any point - then restarting the system and verifying that the operation is correct and no data has been lost to the system.

HCC have also had several of our customers try to break the system but to HCC's pleasure (and we hope their customers' pleasure) they have failed.

Key features

  • 100% Power Fail Safe
  • Small code footprint (typically 5-10K)
  • Tiny RAM usage (typically <100 Bytes)
  • Configurable Filename Length
  • Directory Handling
  • Multiple simultaneous files open
  • Standard File API
  • Reserved Sectors
  • ANSI C compliant C source
  • Sample Drivers for several devices
  • Detailed Implementation Guide
  • uCDrive Connectivity

Supported Devices
TINY is specifically designed for use with flash devices with small erasable sectors. Typically this means devices with eraable sector size <4K Bytes though it can be used on much larger devices. TINY has specifically been tested, verified and has sample drivers for:

  • MSP430 Internal Flash
  • RAM drive in battery backed RAM
  • Atmel DataFlash
  • ST Serial flash for data
  • SST Serial flash devices

All these can be evaluated and tested on the: uCDrive Development Board

TINY is suitable for many more flash types than these - please contact for information about the latest supported devices and those not on this list.

Porting

TINY is designed for ease of porting. It is tested on several target deives in a stand-alone system without an RTOS. We are not aware of any RTOS it cannot easily be ported to.

All the code is supplied in ANSI compliant 'C', is built on several different development environments and run through a syntax checker to ensure the highest level of compatibility.

Also supplied with the system are sample drivers for different media types with clear reference to their hardware dependencies.

The Developer's Guide gives detailed information on all aspects of porting and indicates clearly the areas which may need to be modified for a particular host system. In particular, the host system may provide:

  • real time clock for time/date information - necessary if time/date information is to be stored with files written.
  • semaphores for mutual exclusion - only required in a pre-emptive system.

Sample driver files for a variety of devices are provided with detailed guidance as to how to modify them for different configurations.

HCC is also experienced to provide customised design and development work for your specific project.

Standard File API

General File System Functions
f_getversion Get File System Version Number
f_init Initialise File System

Drive Functions
f_format Format a Drive
f_getfreespace Get Usage Information From a Drive

Directory Functions
f_getcwd Get Current Working Directory
f_getdcwd Get a Drives' Current Working Directory
f_mkdir Make a Directory
f_chdir Change Directory
f_rmdir Remove a Directory

File Access Functions
f_open Open a File
f_close Close a File
f_write Write ro a File
f_read Read from a File
f_seek Set Position in a File
f_tell Get Current File Position
f_eof Check if at End of File
f_rewind Move to Start of File
f_putc Put a Character to a File
f_getc Get a Character from a File

File Control Functions
f_rename Rename a File of Directory
f_delete Delete a File or Directory
f_filelength get the Current Length of a File
f_findfirst Find a File or Directory in the Specified Path
f_findnext Find Next File or Directory in the Specified Path
f_settimedate Set the Time and Date on a File or Directory
f_gettimedate Get the Time and Date from a File or Directory

Note: Although these functions have standard call formats, their names have been prefixed differently to the standard file function definitions to avoid compiler warnings and conflicts when working on systems with another standard API installed. The developer can change these names using defines.

Atmel DataFlash™

TINY-DF

This version of TINY has been specifically designed and optimised to handle DataFlash. These devices have two special features that require special handling in a reliable file system:

  • Each page in each sector must be re-written if that sector has been written to 10K times.
  • The device is accessed through RAM buffers for efficient communication which has the effect that when a page is commited it is first erased and then the new buffer is written - if power is lost during this sequence data may be lost.

TINY-DF has been specifically designed to handle these devices reliably such that the developer does not need to worry about the storage method. The issues are managed in the background adding a minimal overhead to the system - typically < 5% but in the worst case about 15%. The recommended algorithm of copying a page each time one is written would add a 100% overhead and would not be failsafe.

All Atmel DataFlash types are supported.

ST Serial Flash

TINY-ST

This version of TINY has been specifically designed and optimised to handle ST Micro's serial flash for data. These are the M25PExx and M45PExx parts.

All M25PExx and M45PExx types are supported.

Note that the M25Pxx and M45Pxx parts are not supported by TINY because of their large erasable sector size - but they can be supported by the SAFE file system.