eCosPro® Reference Manual
Prev |  | Next

# Chapter 7. Using the NAND library

The eCos NAND library exposes two principal APIs: one for applications to use and the other to communicate with device drivers.

# Configuring the NAND library

The following configuration options are provided. They affect the library globally, i.e. across all drivers.

`CYGPKG_IO_NAND_CFLAGS_ADD`, `CYGPKG_IO_NAND_CFLAGS_REMOVE`

  Allows specific build options to be added to or removed from the CFLAGS list when building this library.

`CYGSEM_IO_NAND_DEBUG`

  This is the master switch for all debug reporting from the library.

`CYGSEM_IO_NAND_DEBUG_FN_DEFAULT`

  This is the default function that the library will use when sending debugging output. It must behave like `printf`. The default - `cyg_nand_defaultprintf` - is a wrapper to `diag_printf`.

  > Note: Individual drivers may override this setting in their `devinit` routines by overwriting the pointer in the device struct.

`CYGSEM_IO_NAND_DEBUG_LEVEL`

  Specifies the verbosity of the NAND library and device drivers. Ranges from 0 (off) to 9 (incredibly verbose); the default setting is 1. (Higher values are only likely to be of use during driver development, if ever.) When enabled, messages are printed using the per-device printf-like function (see above).

  > Note: Should a serious problem be encountered it will always be reported the printf-like function, regardless of this setting. Such messages may be suppressed altogether by turning off `CYGSEM_IO_NAND_DEBUG`.

`CYGSEM_IO_NAND_READONLY`

  Globally disables all code which writes to NAND devices. This may be useful during driver development.

`CYGNUM_NAND_MAX_PARTITIONS`

  Sets a compile-time limit on the number of partitions any NAND device may have. The default is 4, which should be enough for most purposes; unnecessarily setting this higher wastes RAM.

`CYGSEM_IO_NAND_USE_BBT`

  Globally enables and disables the use of Bad Block Table.

  Warning
  This setting should not be disabled lightly! It is strongly recommended that you leave this setting enabled unless you have a very good reason to not use it. It is provided really as a convenience for allowing developers to recover their NAND from a confused state.

Prev | Home | Next
Preparing for deployment | Up | The NAND Application API