STM32F439xx HAL User Manual
Functions
Input and Output functions
NAND Exported Functions

Input Output and memory control functions. More...

Functions

HAL_StatusTypeDef HAL_NAND_Read_ID (NAND_HandleTypeDef *hnand, NAND_IDTypeDef *pNAND_ID)
 Read the NAND memory electronic signature.
HAL_StatusTypeDef HAL_NAND_Reset (NAND_HandleTypeDef *hnand)
 NAND memory reset.
HAL_StatusTypeDef HAL_NAND_ConfigDevice (NAND_HandleTypeDef *hnand, NAND_DeviceConfigTypeDef *pDeviceConfig)
 Configure the device: Enter the physical parameters of the device.
HAL_StatusTypeDef HAL_NAND_Read_Page_8b (NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumPageToRead)
 Read Page(s) from NAND memory block (8-bits addressing)
HAL_StatusTypeDef HAL_NAND_Read_Page_16b (NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint16_t *pBuffer, uint32_t NumPageToRead)
 Read Page(s) from NAND memory block (16-bits addressing)
HAL_StatusTypeDef HAL_NAND_Write_Page_8b (NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumPageToWrite)
 Write Page(s) to NAND memory block (8-bits addressing)
HAL_StatusTypeDef HAL_NAND_Write_Page_16b (NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint16_t *pBuffer, uint32_t NumPageToWrite)
 Write Page(s) to NAND memory block (16-bits addressing)
HAL_StatusTypeDef HAL_NAND_Read_SpareArea_8b (NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaToRead)
 Read Spare area(s) from NAND memory.
HAL_StatusTypeDef HAL_NAND_Read_SpareArea_16b (NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint16_t *pBuffer, uint32_t NumSpareAreaToRead)
 Read Spare area(s) from NAND memory (16-bits addressing)
HAL_StatusTypeDef HAL_NAND_Write_SpareArea_8b (NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaTowrite)
 Write Spare area(s) to NAND memory.
HAL_StatusTypeDef HAL_NAND_Write_SpareArea_16b (NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint16_t *pBuffer, uint32_t NumSpareAreaTowrite)
 Write Spare area(s) to NAND memory (16-bits addressing)
HAL_StatusTypeDef HAL_NAND_Erase_Block (NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress)
 NAND memory Block erase.
uint32_t HAL_NAND_Read_Status (NAND_HandleTypeDef *hnand)
 NAND memory read status.
uint32_t HAL_NAND_Address_Inc (NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress)
 Increment the NAND memory address.

Detailed Description

Input Output and memory control functions.

  ==============================================================================
                    ##### NAND Input and Output functions #####
  ==============================================================================
  [..]  
    This section provides functions allowing to use and control the NAND 
    memory
  

Function Documentation

uint32_t HAL_NAND_Address_Inc ( NAND_HandleTypeDef hnand,
NAND_AddressTypeDef pAddress 
)

Increment the NAND memory address.

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
pAddresspointer to NAND address structure
Return values:
Thenew status of the increment address operation. It can be:
  • NAND_VALID_ADDRESS: When the new address is valid address
  • NAND_INVALID_ADDRESS: When the new address is invalid address

Definition at line 1635 of file stm32f4xx_hal_nand.c.

References NAND_AddressTypeDef::Block, NAND_DeviceConfigTypeDef::BlockSize, NAND_HandleTypeDef::Config, NAND_INVALID_ADDRESS, NAND_VALID_ADDRESS, NAND_AddressTypeDef::Page, NAND_AddressTypeDef::Plane, NAND_DeviceConfigTypeDef::PlaneNbr, and NAND_DeviceConfigTypeDef::PlaneSize.

HAL_StatusTypeDef HAL_NAND_ConfigDevice ( NAND_HandleTypeDef hnand,
NAND_DeviceConfigTypeDef pDeviceConfig 
)

Configure the device: Enter the physical parameters of the device.

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
pDeviceConfigpointer to NAND_DeviceConfigTypeDef structure
Return values:
HALstatus

Definition at line 452 of file stm32f4xx_hal_nand.c.

References NAND_DeviceConfigTypeDef::BlockNbr, NAND_DeviceConfigTypeDef::BlockSize, NAND_HandleTypeDef::Config, NAND_DeviceConfigTypeDef::ExtraCommandEnable, NAND_DeviceConfigTypeDef::PageSize, NAND_DeviceConfigTypeDef::PlaneNbr, NAND_DeviceConfigTypeDef::PlaneSize, and NAND_DeviceConfigTypeDef::SpareAreaSize.

HAL_StatusTypeDef HAL_NAND_Erase_Block ( NAND_HandleTypeDef hnand,
NAND_AddressTypeDef pAddress 
)

NAND memory Block erase.

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
pAddresspointer to NAND address structure
Return values:
HALstatus

Definition at line 1526 of file stm32f4xx_hal_nand.c.

References ADDR_1ST_CYCLE, ADDR_2ND_CYCLE, ADDR_3RD_CYCLE, ADDR_AREA, ARRAY_ADDRESS, CMD_AREA, HAL_GetTick(), HAL_NAND_Read_Status(), HAL_NAND_STATE_BUSY, HAL_NAND_STATE_READY, NAND_HandleTypeDef::Init, NAND_CMD_ERASE0, NAND_CMD_ERASE1, NAND_DEVICE1, NAND_DEVICE2, NAND_READY, NAND_WRITE_TIMEOUT, and NAND_HandleTypeDef::State.

HAL_StatusTypeDef HAL_NAND_Read_ID ( NAND_HandleTypeDef hnand,
NAND_IDTypeDef pNAND_ID 
)

Read the NAND memory electronic signature.

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
pNAND_IDNAND ID structure
Return values:
HALstatus

Definition at line 331 of file stm32f4xx_hal_nand.c.

References ADDR_1ST_CYCLE, ADDR_2ND_CYCLE, ADDR_3RD_CYCLE, ADDR_4TH_CYCLE, ADDR_AREA, CMD_AREA, NAND_IDTypeDef::Device_Id, NAND_IDTypeDef::Fourth_Id, HAL_NAND_STATE_BUSY, HAL_NAND_STATE_READY, NAND_HandleTypeDef::Init, NAND_IDTypeDef::Maker_Id, NAND_CMD_READID, NAND_DEVICE1, NAND_DEVICE2, NAND_HandleTypeDef::State, and NAND_IDTypeDef::Third_Id.

HAL_StatusTypeDef HAL_NAND_Read_Page_16b ( NAND_HandleTypeDef hnand,
NAND_AddressTypeDef pAddress,
uint16_t *  pBuffer,
uint32_t  NumPageToRead 
)

Read Page(s) from NAND memory block (16-bits addressing)

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
pAddresspointer to NAND address structure
pBufferpointer to destination read buffer. pBuffer should be 16bits aligned
NumPageToReadnumber of pages to read from block
Return values:
HALstatus

Definition at line 606 of file stm32f4xx_hal_nand.c.

References ADDR_1ST_CYCLE, ADDR_2ND_CYCLE, ADDR_3RD_CYCLE, ADDR_AREA, ARRAY_ADDRESS, NAND_DeviceConfigTypeDef::BlockNbr, NAND_DeviceConfigTypeDef::BlockSize, CMD_AREA, NAND_HandleTypeDef::Config, NAND_DeviceConfigTypeDef::ExtraCommandEnable, HAL_GetTick(), HAL_NAND_Read_Status(), HAL_NAND_STATE_BUSY, HAL_NAND_STATE_READY, NAND_HandleTypeDef::Init, NAND_CMD_AREA_A, NAND_CMD_AREA_TRUE1, NAND_DEVICE1, NAND_DEVICE2, NAND_READY, NAND_WRITE_TIMEOUT, NAND_DeviceConfigTypeDef::PageSize, and NAND_HandleTypeDef::State.

HAL_StatusTypeDef HAL_NAND_Read_Page_8b ( NAND_HandleTypeDef hnand,
NAND_AddressTypeDef pAddress,
uint8_t *  pBuffer,
uint32_t  NumPageToRead 
)

Read Page(s) from NAND memory block (8-bits addressing)

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
pAddresspointer to NAND address structure
pBufferpointer to destination read buffer
NumPageToReadnumber of pages to read from block
Return values:
HALstatus

Definition at line 474 of file stm32f4xx_hal_nand.c.

References ADDR_1ST_CYCLE, ADDR_2ND_CYCLE, ADDR_3RD_CYCLE, ADDR_AREA, ARRAY_ADDRESS, NAND_DeviceConfigTypeDef::BlockNbr, NAND_DeviceConfigTypeDef::BlockSize, CMD_AREA, NAND_HandleTypeDef::Config, NAND_DeviceConfigTypeDef::ExtraCommandEnable, HAL_GetTick(), HAL_NAND_Read_Status(), HAL_NAND_STATE_BUSY, HAL_NAND_STATE_READY, NAND_HandleTypeDef::Init, NAND_CMD_AREA_A, NAND_CMD_AREA_TRUE1, NAND_DEVICE1, NAND_DEVICE2, NAND_READY, NAND_WRITE_TIMEOUT, NAND_DeviceConfigTypeDef::PageSize, and NAND_HandleTypeDef::State.

HAL_StatusTypeDef HAL_NAND_Read_SpareArea_16b ( NAND_HandleTypeDef hnand,
NAND_AddressTypeDef pAddress,
uint16_t *  pBuffer,
uint32_t  NumSpareAreaToRead 
)

Read Spare area(s) from NAND memory (16-bits addressing)

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
pAddresspointer to NAND address structure
pBufferpointer to source buffer to write. pBuffer should be 16bits aligned.
NumSpareAreaToReadNumber of spare area to read
Return values:
HALstatus

Definition at line 1128 of file stm32f4xx_hal_nand.c.

References ADDR_1ST_CYCLE, ADDR_2ND_CYCLE, ADDR_3RD_CYCLE, ADDR_AREA, ARRAY_ADDRESS, NAND_DeviceConfigTypeDef::BlockNbr, NAND_DeviceConfigTypeDef::BlockSize, CMD_AREA, COLUMN_1ST_CYCLE, COLUMN_2ND_CYCLE, COLUMN_ADDRESS, NAND_HandleTypeDef::Config, NAND_DeviceConfigTypeDef::ExtraCommandEnable, HAL_GetTick(), HAL_NAND_Read_Status(), HAL_NAND_STATE_BUSY, HAL_NAND_STATE_READY, NAND_HandleTypeDef::Init, NAND_CMD_AREA_A, NAND_CMD_AREA_C, NAND_CMD_AREA_TRUE1, NAND_DEVICE1, NAND_DEVICE2, NAND_READY, NAND_WRITE_TIMEOUT, NAND_DeviceConfigTypeDef::PageSize, NAND_DeviceConfigTypeDef::SpareAreaSize, and NAND_HandleTypeDef::State.

HAL_StatusTypeDef HAL_NAND_Read_SpareArea_8b ( NAND_HandleTypeDef hnand,
NAND_AddressTypeDef pAddress,
uint8_t *  pBuffer,
uint32_t  NumSpareAreaToRead 
)

NAND memory read status.

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
Return values:
NANDstatus

Definition at line 1592 of file stm32f4xx_hal_nand.c.

References CMD_AREA, NAND_HandleTypeDef::Init, NAND_BUSY, NAND_CMD_STATUS, NAND_DEVICE1, NAND_DEVICE2, NAND_ERROR, and NAND_READY.

Referenced by HAL_NAND_Erase_Block(), HAL_NAND_Read_Page_16b(), HAL_NAND_Read_Page_8b(), HAL_NAND_Read_SpareArea_16b(), HAL_NAND_Read_SpareArea_8b(), HAL_NAND_Write_Page_16b(), HAL_NAND_Write_Page_8b(), HAL_NAND_Write_SpareArea_16b(), and HAL_NAND_Write_SpareArea_8b().

HAL_StatusTypeDef HAL_NAND_Reset ( NAND_HandleTypeDef hnand)

NAND memory reset.

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
Return values:
HALstatus

Definition at line 405 of file stm32f4xx_hal_nand.c.

References CMD_AREA, HAL_NAND_STATE_BUSY, HAL_NAND_STATE_READY, NAND_HandleTypeDef::Init, NAND_DEVICE1, NAND_DEVICE2, and NAND_HandleTypeDef::State.

HAL_StatusTypeDef HAL_NAND_Write_Page_16b ( NAND_HandleTypeDef hnand,
NAND_AddressTypeDef pAddress,
uint16_t *  pBuffer,
uint32_t  NumPageToWrite 
)

Write Page(s) to NAND memory block (16-bits addressing)

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
pAddresspointer to NAND address structure
pBufferpointer to source buffer to write. pBuffer should be 16bits aligned
NumPageToWritenumber of pages to write to block
Return values:
HALstatus

Definition at line 865 of file stm32f4xx_hal_nand.c.

References ADDR_1ST_CYCLE, ADDR_2ND_CYCLE, ADDR_3RD_CYCLE, ADDR_AREA, ARRAY_ADDRESS, NAND_DeviceConfigTypeDef::BlockNbr, NAND_DeviceConfigTypeDef::BlockSize, CMD_AREA, NAND_HandleTypeDef::Config, HAL_GetTick(), HAL_NAND_Read_Status(), HAL_NAND_STATE_BUSY, HAL_NAND_STATE_READY, NAND_HandleTypeDef::Init, NAND_CMD_AREA_A, NAND_CMD_WRITE0, NAND_CMD_WRITE_TRUE1, NAND_DEVICE1, NAND_DEVICE2, NAND_READY, NAND_WRITE_TIMEOUT, NAND_DeviceConfigTypeDef::PageSize, and NAND_HandleTypeDef::State.

HAL_StatusTypeDef HAL_NAND_Write_Page_8b ( NAND_HandleTypeDef hnand,
NAND_AddressTypeDef pAddress,
uint8_t *  pBuffer,
uint32_t  NumPageToWrite 
)

Write Page(s) to NAND memory block (8-bits addressing)

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
pAddresspointer to NAND address structure
pBufferpointer to source buffer to write
NumPageToWritenumber of pages to write to block
Return values:
HALstatus

Definition at line 737 of file stm32f4xx_hal_nand.c.

References ADDR_1ST_CYCLE, ADDR_2ND_CYCLE, ADDR_3RD_CYCLE, ADDR_AREA, ARRAY_ADDRESS, NAND_DeviceConfigTypeDef::BlockNbr, NAND_DeviceConfigTypeDef::BlockSize, CMD_AREA, NAND_HandleTypeDef::Config, HAL_GetTick(), HAL_NAND_Read_Status(), HAL_NAND_STATE_BUSY, HAL_NAND_STATE_READY, NAND_HandleTypeDef::Init, NAND_CMD_AREA_A, NAND_CMD_WRITE0, NAND_CMD_WRITE_TRUE1, NAND_DEVICE1, NAND_DEVICE2, NAND_READY, NAND_WRITE_TIMEOUT, NAND_DeviceConfigTypeDef::PageSize, and NAND_HandleTypeDef::State.

HAL_StatusTypeDef HAL_NAND_Write_SpareArea_16b ( NAND_HandleTypeDef hnand,
NAND_AddressTypeDef pAddress,
uint16_t *  pBuffer,
uint32_t  NumSpareAreaTowrite 
)

Write Spare area(s) to NAND memory (16-bits addressing)

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
pAddresspointer to NAND address structure
pBufferpointer to source buffer to write. pBuffer should be 16bits aligned.
NumSpareAreaTowritenumber of spare areas to write to block
Return values:
HALstatus

Definition at line 1396 of file stm32f4xx_hal_nand.c.

References ADDR_1ST_CYCLE, ADDR_2ND_CYCLE, ADDR_3RD_CYCLE, ADDR_AREA, ARRAY_ADDRESS, NAND_DeviceConfigTypeDef::BlockNbr, NAND_DeviceConfigTypeDef::BlockSize, CMD_AREA, COLUMN_1ST_CYCLE, COLUMN_2ND_CYCLE, COLUMN_ADDRESS, NAND_HandleTypeDef::Config, HAL_GetTick(), HAL_NAND_Read_Status(), HAL_NAND_STATE_BUSY, HAL_NAND_STATE_READY, NAND_HandleTypeDef::Init, NAND_CMD_AREA_A, NAND_CMD_AREA_C, NAND_CMD_WRITE0, NAND_CMD_WRITE_TRUE1, NAND_DEVICE1, NAND_DEVICE2, NAND_READY, NAND_WRITE_TIMEOUT, NAND_DeviceConfigTypeDef::PageSize, NAND_DeviceConfigTypeDef::SpareAreaSize, and NAND_HandleTypeDef::State.

HAL_StatusTypeDef HAL_NAND_Write_SpareArea_8b ( NAND_HandleTypeDef hnand,
NAND_AddressTypeDef pAddress,
uint8_t *  pBuffer,
uint32_t  NumSpareAreaTowrite 
)

Write Spare area(s) to NAND memory.

Parameters:
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
pAddresspointer to NAND address structure
pBufferpointer to source buffer to write
NumSpareAreaTowritenumber of spare areas to write to block
Return values:
HALstatus

Definition at line 1264 of file stm32f4xx_hal_nand.c.

References ADDR_1ST_CYCLE, ADDR_2ND_CYCLE, ADDR_3RD_CYCLE, ADDR_AREA, ARRAY_ADDRESS, NAND_DeviceConfigTypeDef::BlockNbr, NAND_DeviceConfigTypeDef::BlockSize, CMD_AREA, COLUMN_1ST_CYCLE, COLUMN_2ND_CYCLE, COLUMN_ADDRESS, NAND_HandleTypeDef::Config, HAL_GetTick(), HAL_NAND_Read_Status(), HAL_NAND_STATE_BUSY, HAL_NAND_STATE_READY, NAND_HandleTypeDef::Init, NAND_CMD_AREA_A, NAND_CMD_AREA_C, NAND_CMD_WRITE0, NAND_CMD_WRITE_TRUE1, NAND_DEVICE1, NAND_DEVICE2, NAND_READY, NAND_WRITE_TIMEOUT, NAND_DeviceConfigTypeDef::PageSize, NAND_DeviceConfigTypeDef::SpareAreaSize, and NAND_HandleTypeDef::State.