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

THIN File System

A highly optimised, reduced footprint FAT File systems

A highly optimised, reduced footprint version of our highly successful FAT system. This DOS compatible file system is designed for integrating with a typical 8-bit CPU with limited resources. The system is primarily tested and verified on 8051, MSP430 and H8S series MCUs and is suitable for using on most 8 or 16 bit CPUs.

The system is scalable - select only the functionality required for your application and highly optimised for both speed and size.

One of our customers described THIN as "a work of art"!

THIN can be tested on the: uCDrive Development Board

THIN is shipped royalty free, with 6 months support (email or telephone) and 1 year's free upgrades.

 

Scalable

THIN is a DOS compatible flash file system which is designed to be extremely scalable to allow the developer with limited resources to build exactly the system they need and no more. The system is fully featured giving the developer the option of enabling new options as requirements change.

It is not possible to give definitive figures for footprint's because of the differences between the processors and development tools - the following is for indication only. These are based on estimates made for the 8-bit 8051 MCU built with the Keil development suite.

Code Footprint
Depending on the options selected at build time the code footprint of the file system can be less than 4k for a minumum DOS compatible system for accessing files on a disk to around 20K for a complete file system with all options enabled including disk formatting; a large section.
Data Footprint

THIN works completely independently from any host system and memory is statically allocated - i.e. no requirement for a heap to be provided. The typical total data footprint is <<1K plus 0.5k for each simultaneous file that is allowed to be open.

Stack Requirement

Typically the stack requirement for any call to the file system is much less than 0.5K. The developers guide provides guideline information about the specific stack requirements in different configuations.

Options

The system contains a large number of build options which are detailed in the developer guide. Some of the options are:

  • F_FAT12
  • F_FAT16
  • F_FAT32
  • F_FORMAT
  • F_LONGFILES
  • F_WRITE
  • F_NAMECHECKING
  • F_WILDCARDS
  • F_DIRECTORIES
  • ... and many, many more

For a complete list consult the developer's guide.

Each and every API call is also individually selectable automatically removing unnecessary sub-routines

Speed

One key feature of systems with limited resources is that they have limited MIPS for processing and in particular communications tasks place a significant burden on the host MCU.

With THIN HCC has made great efforts to provide the most efficient possible 'C' source code suitable for 8/16-bit MCUs. This has been done by a combination of detailed code analysis and optimisation - and also by the provision of a large range of developer options to avoid the inclusion of unnecessary code. Embedded systems are by their very nature "specialised" and THIN makes the creation of a "specialised" system as easy as possible.

Minimising the code footprint generally helps improve performance and additionally key parts of driver routines have also been re-coded in 8051 assembler to give the best possible receive and transmission rates with minimum MCU load. These assembler routines are available in C also and make excellent templates for any target MCU.

An additional feature of the system is the limited use of copy functions. In most cases reads from a file, and writes to a file, are done with zero internal copies - thus putting the minimum load on the MCU while achieving the maximum throughput.

Porting

THIN is designed to be very portable. It is tested on several commercial RTOSs and also in a stand-alone system with no 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 4 different development environments and run through a syntax checker to ensure the highest level of compatibility.

Also supplied with the system is sample application code for easy exercise of the system - and 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.
  • random number - serial number generation during format - recommended only if formatting of media is required.
  • semaphores for mutual exclusion - only required in a pre-emptive system.

The Developer's guide gives detailed information of how to scale the system:

  • which functions to exclude
  • the effect of excluding/including a particular option
  • selecting FAT12/16/32 support
  • selecting long or 8.3 name support
  • a variety of code validation functions

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

Media Types

THIN is designed to interface to virtually any standard DOS file system compatible device through standard interface routines (read_sector(), write_sector() etc.). Provided with THIN is a set of reference drivers for quick and risk free integration.

MultiMediaCard, Secure Digital and SDHC Cards

This is probably the simplest method to add a DOS compatible file media to your embedded device. HCC provide a range of drivers for interfacing to SD, SDHC and MMC cards including standard SPI implemented in either hardware or software. HCC provide hardware design information for implementing this.

Compact Flash Cards

Compact Flash cards require a more complex communication with a PC compatible media but offers performance advantages because of the wider data bus thus generally a higher throughput is achieved and in many cases a reduced CPU load. HCC also provide hardware design information for implementing this.

Atmel DataFlash

Two types of driver are provided for use with all types of Atmel DataFlash.

A simple driver which does a direct mapping of Dataflash pages to the logical disk is provided as standard.

A more complex driver, see DFML, which handles the DataFlash in a more reliable way may be ordered separately.

NAND Flash

HCC have a Flash Translation Layer product which allows an array of NAND flash to appear to the file system as a set of consistent logical sectors. FTL can provide the driver layer for THIN.

For more details about this see FTL.

RAM Drive

A RAM drive is provided which is useful for application development though only on systems with significant amounts of RAM available to store a minimum file system with FATs etc.

Other Devices

HCC are always adding to their list of supported devices and will also develop specific drivers upon request - contact HCC-Embedded to discuss your requirements.

Key features

  • FAT12, FAT16 and FAT32
  • Long filenames
  • Highly scalable
  • Small Footprint
  • Low memory resource usage
  • Media Error Handling
  • Fully PC compatible
  • ANSI C compliant C source


Standard File API

General File System Functions
f_getversion Get File System Version Number
f_initvolume Initialise a Volume

Drive Functions
f_mountdrive Mount a Drive
f_format Format a Drive
f_hardformat Hard Format a Drive
f_getfreespace Get Usage Information From a Drive
f_setlabel Set the Label on a Volume
f_getlabel Get the Label on a Volume

Directory Functions
f_getcwd Get 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
f_setattr Set the Attributes on a File or Directory
f_getattr Get the Attributes 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.

MCUs

THIN has primarily been developed on an 8051 platform with Keil development tools and with Hitachi/Renasas H8S series 16-bit MCU with GNU tools.

All the code is available in 'C' source code verified over several RTOS's and development environments. Porting to a new MCU is therefore straightforward and the points at which it may be worth spending a few hours adding some assembler are clearly indicated with 8051 sample code available as a possible starting point.

HCC will also provide porting services for particular platforms as required. Our extensive experience with file systems and a wide variety of platforms can give your development a cost effective head start.

8051

THIN was initially developed on an 8051 platform with Keil development tools.

Because of the huge range of 8051's it is not possible to give a complete list of supported devices. The basic requirements are: >1K RAM - 2.5K would be normal for file system plus a reasonable application. >10K ROM - if a read/write file system is required

An MMC/SD card can be connected to most to most 8051's through an SPI port or through an SPI port simulated in software. Tested sample drivers are provided for both options - critical parts of which have been coded in 8051 assembler for best performance. Additionally a further two GPIO pins may be allocated for Card Detect and Write Protect if required.

A Compact Flash card may also be connected via the databus and additional control lines. HCC can provide hardware reference design information for this.

If you have specific enquiries regarding the suitability of your particular device please contact .

MSP430

The MSP430 family of ultra-low-power 16-bit RISC mixed-signal processors from Texas Instruments provides the ultimate solution for battery-powered measurement applications.

Several of these devices are suitable for the connection of an MMC/SD card for PC compatible data storage. All MSP430 devices for use with THIN support SPI which makes the interface to an SD/MMC card simple and efficient. Additional to the SPI port pins two additonal GPIOs from the MSP430 may be used for Card Detect and Write Protect if required.

The following devices with 5-10KB of RAM are recommended for use with THIN:

  • MSP430F1610
  • MSP430F1612
  • MSP430F1611
The following devices with 2KB of RAM may be used with THIN:
  • MSP430F148
  • MSP430F1481
  • MSP430F149
  • MSP430F1491
  • MSP430F168
  • MSP430F169
  • MSP430F448
  • MSP430F449
  • MSP430F438
  • MSP430F439
Note: on an MSP430 the minimum build of THIN including an MMC card driver uses less than 800bytes of RAM!

HCC-Embedded has tested drivers for the MSP430 range - proven on TI's FET development boards using IAR's Embedded WorkBench.

If you have any questions regarding these or other devices please send email to .

Unified API

Several of Atmel's ATmega flash microcontrollers are suitable for the connection of an MMC/SD card for PC compatible data storage. All these devices for use with THIN support SPI which makes the interface to an SD/MMC card simple and efficient. Additional to the SPI port pins two additonal GPIOs from the ATmega may be used for Card Detect and Write Protect if required.

The following devices with 4-8KB of RAM are recommended for use with THIN:

  • ATmega128
  • ATmega128L
  • ATmega64
  • ATmega645
  • ATmega6450
  • ATmega64L
The following devices with 2KB of RAM may be used with THIN:
  • Atmega325
  • Atmega3250
  • Atmega32L
Note: these 2KB RAM devices can only be used with a minimal build of THIN. Using THIN with these devices leaves very little memory for any user application - approximately 200bytes.

HCC-Embedded has developed and tested sample drivers for use on ATmega devices.

If you have any questions regarding these or other devices please send email to .