The following utilities are included with the NAND library.
They are standalone eCos applications; for convenience, you can set
CYGBLD_IO_NAND_BUILD_UTILS in your eCos configuration
and they will be built and placed into
install/tests/io/nand/current/utils.
erasenand.c
Loops over all the blocks of a partition, erasing all the blocks which are not
marked as bad. The device and partition to erase are set by #define.
Note: This will not normally erase the Bad Block Table. This is because
the BBT reports its own blocks as "Reserved" when queried via
cyg_nand_bbt_query, which makes them inaccessible
to applications. However, if
CYGSEM_IO_NAND_USE_BBT is turned off, then any BBT
present will not be detected and hence will be erased.
erase_bbt_dangerous.c
Erases the NAND blocks comprising the primary and mirror bad-block tables of a device.
The device to erase is set by #define.
(The tables are detected by the library in the usual way. If none are present, the
library will scan the device for factory-bad blocks to create such a table, then this
code will immediately erase it.)
Warning
It is particularly dangerous to run this utility
on a production device, as it is generally not possible to later
reconstruct the list of factory-bad blocks. It is intended only as an
aid to driver authors.