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
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_BBTis turned off, then any BBT present will not be detected and hence will be erased.
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.)
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.