This is the HCC Embedded Product Documentation.

HCC Embedded Main Website   |    HCC Documentation Home Page  |     Contacting HCC Embedded

THIN handles most of the features of a FAT file system with no need for explanation of the underlying issues. However, this section describes some areas which you do need to understand.

Removable media may be formatted in three different ways:

  • Completely unformatted.
  • Master Boot Record (MBR).
  • Boot Sector Information only.

The following sections describe how the system handles these three situations.

Completely Unformatted Media

An unformatted drive is not useable until it has been formatted. Most flash cards are pre-formatted, whereas hard disk drives tend to be unformatted when delivered. When f_format() is called, the drive is formatted with Boot Sector Information. This is exactly the same as if f_hardformat() had been issued at any time.

The format of the file medium is determined by the number of clusters on it. Information about the connected device is given to the system from the f_getphy() call, from which the number of available clusters on the device is calculated.

Refer to the f_hardformat() and f_format() functions for a description of how to choose the format type (FAT12/16/32).

Master Boot Record (MBR)

As standard, the file system does not hard format a card with an MBR but with Boot Sector Information. A hard format removes the MBR information.

When a device with an MBR is inserted, it is treated as though it has just one partition (the first in the partition table).

Boot Sector Information

If f_hardformat() is called, the card is always formatted with the Boot Sector Information table in the first sector.