HAL NAND How to Use

group NAND_How_To_Use

How to use the NAND HAL module driver

The FMC NAND main features:

This NAND HAL driver is a generic driver which contains a set of APIs used to configure the FMC NAND banks and to interface with legacy and ONFI (Open NAND Flash Interface) NAND memories.

The NAND HAL driver can be used as follows:

This module provides these different sets of APIs that allow to :

1- Initialize and deinitialize the logical FMC NAND object ( hal_nand_handle_t) and retrieve the associated NAND peripheral instance :

  • Initialize the logical FMC NAND object and associate it to a physical instance. This functionality is ensured by HAL_NAND_Init() function.

  • Deinitialize the logical FMC NAND object and disable the NAND bank. This functionality is ensured by HAL_NAND_DeInit() function.

  • Retrieve the NAND instance by calling HAL_NAND_GetInstance().

2- Configure the FMC NAND to be ready to use and retrieve the current configuration :

  • Configure the FMC NAND through these steps by following the order below :

    • Step 1 (FMC configuration) : is the first step to perform once the HAL NAND driver is initialized. This functionality is ensured by HAL_NAND_SetConfig() function.

      At this stage, the NAND is partially configured but not yet ready to use.

    • Step 2 (Memory configuration) : is the second step to perform once the FMC is configured. This functionality is ensured by HAL_NAND_SetConfigMemory() function.

    • Step 3 (Optional based on the external memory) : is the third step to perform optionally once the FMC and memory are configured. It sets a different timing configuration for the last write access when needed. This functionality is ensured by HAL_NAND_SetLastWriteAccessTiming() function, and it must be called after HAL_NAND_SetConfigMemory().

      At this stage, the memory is partially configured but not ready to use.

    • Step 4 (Partition configuration) : is the fourth step to perform once the FMC and memory are configured. This functionality is ensured by one of these two functions :

      At this stage, the memory is fully configured and ready to use for polling process.

    For polling process, the timeout values can be modified when the memory is fully configured. This functionality is ensured by these functions :

  • Retrieve the current configuration through the following functions :

3- Interface with legacy and ONFI NAND memories by controlling the input and output access operations.

4- Manage the FMC NAND peripheral access when it is fully configured : This functionality is ensured by these functions :

5- Store and retrieve user data : This functionality is ensured by these functions :

6- Retrieve the global state, the kernel clock frequency and the NAND instance : This functionality is ensured by these functions :