English
Language : 

AN4570 Datasheet, PDF (21/46 Pages) STMicroelectronics – This application note describes how to use the high-density
AN4570
Interfacing with a non-multiplexed, asynchronous 16-bit NOR Flash memory
{
/* Write data to NOR */
HAL_NOR_Program(&norHandle,
(uint32_t *)(NOR_DEVICE_ADDR + uwStartAddress),
pData);
/* Read NOR device status */
if(HAL_NOR_GetStatus(&norHandle,
NOR_DEVICE_ADDR,
PROGRAM_TIMEOUT) != NOR_SUCCESS)
{
return NOR_ERROR;
}
/* Update the counters */
index--;
uwStartAddress += 2;
pData++;
}
return NOR_OK;
}
/**
* @brief Reads an amount of data from the NOR device.
* @param uwStartAddress: Read start address
* @param pData: Pointer to data to be read
* @param uwDataSize: Size of data to read
* @retval NOR memory status
*/
uint8_t NOR_ReadData(uint32_t uwStartAddress,
uint16_t* pData,
uint32_t uwDataSize)
{
if(HAL_NOR_ReadBuffer(&norHandle,
NOR_DEVICE_ADDR + uwStartAddress,
pData, uwDataSize) != HAL_OK)
{
return NOR_ERROR;
}
else
{
return NOR_OK;
}
}
DocID026804 Rev 1
21/46
45