NOR Flash
SAFE is designed to support all types of standard NOR flash.
General
NOR
flash is one of the base building blocks of most embedded systems. It
contains non-volatile storage of data and code for systems and is
characterised by having storage that can only be written to if
previously erased and erasable blocks with relatively long erase times. Wear-leveling
Flash devices suffer from
over-use - if a particular block is used beyond the manufacturer's
specification the block may eventually develop errors. To combat this
wear-level algorithms are implemented which ensure an even usage of the
blocks. In addition the method of recording changes to the file
descriptors ensures that the minimum of writing is done. Bad-Block Management
Bad blocks may develop in a device over time. These are automatically detected and are paged out of the file system. Reserved Sectors
Often
developers require that sections of their flash device are reserved for
a particular purpose outside of the file system. This is achieved by
specifying in the driver which of the available blocks are for
"private" use. The user can still use the standard low-level
read/write/erase routines for accessing these blocks. Flash Arrays
Often it is useful to use
multiple flash devices in a system either in parallel - to widen the
data bus and acheive higher performance, or in series to increase
storage size. This behaviour is fully supported by the system and
relies only on configuration changes to the drivers. Sample Drivers
Provided with the system
is a range of sample drivers for various flash devices from different
manufacturers. The sample drivers are carefully documented in the
Developer's guide to allow easy porting to wahtever chip/hardware
configuration is required. Devices Supported
There are literally
thousands of NOR flash devices available all with slightly different
characteristics while retaining the same base properties. The system
supports all known manufacturers devices including:
- AMD/Fujutsi/Spansion flash chips including MirrorBit technology and partnumber 29xxxxxxx
- Intel StrataFlash
- Atmel devices including the small memory devices
- Sharp
- SST including 25 and 39 series
- Toshiba
Sample drivers are provided for a number of these devices.
NAND Flash SAFE is designed to support all types of standard NAND flash.
General
NAND
flash is a relatively new flash technology designed to store large
amounts of non-volatile data at reduced cost. It is characterised by
having storage that can only be written to if previously erased - these
blocks erase quicker than on NOR flash but is still quite long. Other
features that differentiate it from NOR flash are that it is often
shipped with a number of bad-blocks and their reliability is much
increased if all single bit errors are detected and fixed. Wear-leveling
Flash devices suffer from
over-use - if a particular block is used beyond the manufacturer's
specification the block may eventually develop errors. To combat this
wear-level algorithms are implemented which ensure an even usage of the
blocks. In addition the method of recording changes to the file
descriptors ensures that the minimum of writing is done. Bad-Block Management
Bad blocks may
exist on a new device and also develop in a device over time. These are
automatically detected and are paged out of the file system. ECC Algoritms
A highly efficient ECC
algorithm is provided with the system. This may be implemented either
in hardware or software. The algorithm automatically corrects all
single bit errors- thus substantially increasing the relaibility of the
devices. Reserved Sectors
Developers sometimes
require that sections of their flash device are reserved for a
particular purpose outside of the file system. This is achieved by
specifying in the driver which of the available blocks are for
"private" use. The user can still use the standard low-level
read/write/erase routines for accessing these blocks. Flash Arrays
Often it is useful to use
multiple flash devices in a system either in parallel - to widen the
data bus and acheive higher performance, or in series to increase
storage size. This behaviour is fully supported by the system and
relies only on configuration changes to the drivers. Sample Drivers
Provided with the system
is a range of sample drivers for various flash devices from different
manufacturers. The sample drivers are carefully documented in the
Developer's guide to allow easy porting to whatever chip/hardware
configuration is required. Devices Supported
There are many
different NAND flash devices available all with slightly different
characteristics while retaining the same base properties. The system
supports all known manufacturers devices including:
- Samsung
- Hitachi
- Toshiba
- Micron
- ST Micro
Sample drivers are provided for Samsung, ST, and Micron devices
Atmel DataFlash®
SAFE supports all types of Atmel DataFlash
Introduction
These
devices have special characteristics which makes them difficult to use
in a reliable and failsafe way. In particular if the pages in a sector
are written to 10k times then the system must ensure that all pages in
that sector have been rewritten during that period. Additonally, a
simple copy erase and copyback mechanism is unreliable because if power
is lost during this process a random page of data may be lost from the
system. HCC have provided a reliable and failsafe driver which manages
these issues and ensures that these devices can be used in a reliable
file system. Wear-leveling
Flash devices suffer from
over-use - if a particular block is used beyond the manufacturer's
specification the block may eventually develop errors. To combat this
wear-level algorithms are implemented which ensure an even usage of the
blocks. In addition the method of recording changes to the file
descriptors ensures that the minimum of writing is done. Reserved Sectors
Developers sometimes
require that sections of their flash device are reserved for a
particular purpose outside of the file system. This is achieved by
specifying in the driver which of the available blocks are for
"private" use. The user can still use the standard low-level
read/write/erase routines for accessing these blocks. SPI Sample Drivers
Provided with the
system is a simlpe SPI driver which is the only part which must be
ported to the target. The Developer's guide exlains the steps to allow
easy porting Devices Supported
All Atmel Dataflash types are supported:
- AT45DB011B
- AT45DB021B
- AT45DB041B
- AT45DB081B
- AT45DB161B
- AT45DB161D
- AT45DB321B
- AT45DB642
- AT45DB642B
- AT45DB642D (including both page modes)
The specific DataFlash device type may be selected through a definition in the driver.
Other Devices
SAFE has a flexible architecture and is suitable for using with any device where guaranteed reliability is required.
The
interface between the drivers and the file system is clearly defined -
any device which can provide a block architecture with read, write and
erase sector functions can be integrated. The driver must supply to the
file system a logical description of the blocks which may be used. The
developer's guide gives detailed information to the required interface
functions and in addition a RAM drive is supplied which may act as a
useful starting point or reference .
Porting
SAFE
is designed to be very portable. It is tested on several commercial
RTOSs and also 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 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.
- 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 |
Initialize File System |
| f_staticwear |
Execute Static Wear |
Drive Functions
|
| fs_mountdrive |
Mount a Drive |
| f_format |
Format a Drive |
| f_getfreespace |
Get Usage Information From a Drive |
| f_getdrive |
Get Current Drive Number |
| f_chdrive |
Change Current 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_flush |
Flush a File to Flash |
| 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 |
| f_truncate |
Truncates a File |
File Control Functions
|
| f_rename |
Rename a File of Directory |
| f_move |
Moves 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_setpermission |
Set the Permissions on a File or Directory |
| f_getpermission |
Get the Permissions 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. |
Unified API
Unified API for the SAFE and FAT file systems
For
developers who require failsafe access to their NOR and NAND targeted
filesystems (SAFE) and access to their PC compatible devices (FAT) we
provide a Unified API. The Unified API allows both file systems to be accessed
through a single interface - seemlessly giving all the advantages of
the failsafe system and the PC compatible system. The two systems work
entirely independently and a wrapper layer is provided to manage all
file system calls. This ensures that neither system's performance is
influenced by the alternate system. The Unified API is provided free of charge to customers using both the FAT and SAFE file systems on a product |