1.1.4.1 How the Library Works

The NAND flash driver library is a single-client, single-instance based driver interface.

Abstraction Model

The NAND Flash driver interface provides read, write and erase functions that abstract out the internal workings of the NAND Flash driver and the underlying External Bus Interface (EBI)/NAND Flash Controller.

drv_nand_flash_abstraction_model

Working flow

  • The NAND Flash Driver performs initialization and puts the driver to ready state. This status of the driver can be checked using DRV_NAND_FLASH_Status()

  • The NAND Flash driver library performs set of flash operations during DRV_NAND_FLASH_Open(). If any of the below flash operations fails, an invalid Handle will be returned. DRV_NAND_FLASH_Open() can be repeatedly called until it returns a valid handle.

    • Resets the NAND Flash device

    • Reads the Parameter page of the NAND Flash device

    • Setup the PMECC descriptor if PMECC enabled

  • The NAND Flash driver library reads NAND Flash geometry using DRV_NAND_FLASH_GeometryGet().

  • The NAND Flash driver library performs a block erase using DRV_NAND_FLASH_SkipBlock_BlockErase().

  • The NAND Flash driver library performs a page and block write using DRV_NAND_FLASH_SkipBlock_PageWrite() and DRV_NAND_FLASH_SkipBlock_BlockWrite() respectively.

  • The NAND Flash driver library performs a page and block read using DRV_NAND_FLASH_SkipBlock_PageRead() and DRV_NAND_FLASH_SkipBlock_BlockRead() respectively.