English
Language : 

AN4570 Datasheet, PDF (15/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
/* Includes ---------------------------------------------------------------
---*/
#include "stm32f3xx_hal.h"
/* Private define ---------------------------------------------------------
---*/
#define NOR_DEVICE_ADDR ((uint32_t)0x64000000)
/* #define NOR_MEMORY_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_8 */
#define NOR_MEMORY_WIDTH FMC_NORSRAM_MEM_BUS_WIDTH_16
#define NOR_BURSTACCESS FMC_BURST_ACCESS_MODE_DISABLE
/* #define NOR_BURSTACCESS FMC_BURST_ACCESS_MODE_ENABLE*/
#define NOR_WRITEBURST FMC_WRITE_BURST_DISABLE
/* #define NOR_WRITEBURST FMC_WRITE_BURST_ENABLE */
/* NOR operations Timeout definitions */
#define BLOCKERASE_TIMEOUT ((uint32_t)0x00A00000) /* NOR block erase
timeout */
#define CHIPERASE_TIMEOUT ((uint32_t)0x30000000) /* NOR chip erase
timeout */
#define PROGRAM_TIMEOUT
*/
((uint32_t)0x00004400) /* NOR program timeout
#define BUFFER_SIZE
#define WRITE_READ_ADDR
((uint32_t)16)
((uint32_t)0x20800)
/* NOR Ready/Busy signal GPIO definitions */
#define NOR_READY_BUSY_PIN GPIO_PIN_6
#define NOR_READY_BUSY_GPIO GPIOD
#define NOR_READY_STATE
GPIO_PIN_SET
#define NOR_BUSY_STATE
GPIO_PIN_RESET
#define NOR_OK
#define NOR_ERROR
0x00
0x01
/* Private variables ------------------------------------------------------
---*/
static NOR_HandleTypeDef norHandle;
static FMC_NORSRAM_TimingTypeDef Timing;
static NOR_IDTypeDef NOR_ID;
static uint16_t nor_aTxBuffer[BUFFER_SIZE] = {0x00, 0x01, 0x02, 0x03,
0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0A, 0x0B,
0x0C, 0x0D, 0x0E, 0x0F};
DocID026804 Rev 1
15/46
45