User`s manual

Dynamic C Users Manual digi.com 129
10. FILE SYSTEMS
This chapter describes two separate file systems that can be used on Rabbit-based systems. The file system
described in Section 10.1 works with all versions of Dynamic C for the Rabbit 2000 and 3000 micropro-
cessors. The FAT file system described in Section 10.2 requires Dynamic C 8.51 or later. There have been
several updates to the FAT file system to include additional flash devices.
FAT version 1.02 supports SPI-based serial flash devices. FAT versions 2.01 and 2.05 also support SPI-
based serial flash devices and require Dynamic C 9.01 or later. FAT version 2.05 introduces support for
NAND flash devices. FAT version 2.10 extends µC/OS-II compatibility to make the FAT API reentrant
from multiple tasks. FAT version 2.13 adds support for SD cards and requires Dynamic C 9.60 or later. In
all versions of the FAT, a battery-backed write-back cache reduces wear on the flash device and a round-
robin cluster assignment helps spread the wear over its surface.
10.1 FS2
The Dynamic C file system, known as the filesystem mk II or simply as FS2, was designed to be used with
a second flash memory or in SRAM on Rabbit 2000- or 3000-based boards.
FS2 allows:
the ability to overwrite parts of a file
the simultaneous use of multiple device types
the ability to partition devices
efficient support for byte-writable devices
better performance tuning
a high degree of backwards compatibility with its predecessor
all necessary run-time data to be reconstructed on power up
NOTE: Dynamic C’s low-level flash memory access functions should not be used in the
same area of the flash where the flash file system exists.
10.1.1 General Usage
The recommended use of a flash file system is for infrequently changing data or data rates that have writes
on the order of tens of minutes instead of seconds. Rapidly writing data to the flash
i
could result in using
up its write cycles too quickly. For example, consider a 256K flash with 64 blocks of 4K each. Using a
flash with a maximum recommendation of 10,000 write cycles means a limit of 640,000 writes to the file
system. If you are performing one write to the flash per second, in a little over a week you will use up its
recommended lifetime.
i. All other code, including ISRs, is suspended while writing to flash.