The following section shows an example on how to get started in a typical case comprising the following:
- The generic controller layer implementation (included with the NAND driver)
- The 1-bit software ECC implementation (included with the NAND driver)
- The static part layer implementation (included with the NAND driver)
- Your BSP layer implementation to adapt the driver to your specific platform
In case you need additional information and details regarding the different layers, please refer to the Architecture Overview.
To use the NAND driver, you must include the following ten files in the build, in addition to the generic file system files:
fs_dev_nand.c
(\Micrium\Software\uC-FS\Dev\NAND
.)fs_dev_nand.h
(\Micrium\Software\uC-FS\Dev\NAND
.)fs_dev_nand_ctrlr_gen.c
(\Micrium\Software\uC-FS\Dev\NAND\Ctrlr
)fs_dev_nand_ctrlr_gen.h
(\Micrium\Software\uC-FS\Dev\NAND\Ctrlr
)fs_dev_nand_part_static.c
(\Micrium\Software\uC-FS\Dev\NAND\Part
)fs_dev_nand_part_static.h
(\Micrium\Software\uC-FS\Dev\NAND\Part
)ecc_hamming.c
(\Micrium\Software\uC-CRC\Source
)ecc_hamming.h
(\Micrium\Software\uC-CRC\Source
)ecc.h
(\Micrium\Software\uC-CRC\Source
)- Your BSP layer implementation (derived from
fs_dev_nand_ctrlr_gen_bsp.c
in\Micrium\Software\uC-FS\Dev\NAND\BSP\Template
).
The example in shows how to open a single NAND volume. The file system initialization function (FS_Init()
) must have previously been called.
If the NAND initialization succeeds, the file system traces (if a sufficiently high trace level is configured) will produce an output similar to . See section Trace Configuration about configuring the trace level.
Handling different use-cases
If the above example does not apply to your situation, we strongly recommend you read the sections about the different layers. This will help you determine if other existing implementations are suitable for you, or if you need to develop your own implementation of some of those layers.