LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
LPC17xx/40xx External NAND Flash tests

Detailed Description

Example description
The Flash example shows how to use external NAND Flash using EMC.
The example allows you to place a small string in a sector of the Flash and the string will remain across reset cycles. No attempt at ECC is made in this example (which is required for data reliability for NAND FLASH).

To use the example, connect a serial cable to the board's RS232/UART port and start a terminal program to monitor the port. The terminal program on the host PC should be setup for 115K8N1.

Special connection requirements
JP2: 3-4 is ON

Build procedures:
LPC17xx/40xx example quickstart for Keil uVision4
LPC17xx/40xx example quickstart for IAR EWARM
LPC17xx/40xx example quickstart for Code Red Xpresso

Supported boards and board setup:
Embedded Artists' LPC1788 Developer's Kit
Embedded Artists' LPC4088 Developer's Kit

Submitting LPCOpen issues:
Community support for LPCOpen

Macros

#define BLOCK_INDEX   1
 
#define PAGE_INDEX   0
 
#define BUFFER_SIZE   0x40
 
#define CHKTAG   "NxP"
 
#define CHKTAG_SIZE   3
 
#define ESC_CHAR   27
 

Functions

static void ShowString (char *str)
 
static uint32_t MakeString (uint8_t *str)
 
STATIC void waitForReady (void)
 
bool checkBadBlock (uint32_t block)
 
int main (void)
 Main routine for example_nandflash.
 

Variables

uint32_t buffer [BUFFER_SIZE/sizeof(uint32_t)]
 

Macro Definition Documentation

#define BLOCK_INDEX   1

Definition at line 70 of file nandflash.c.

#define BUFFER_SIZE   0x40

Definition at line 74 of file nandflash.c.

#define CHKTAG   "NxP"

Definition at line 77 of file nandflash.c.

#define CHKTAG_SIZE   3

Definition at line 78 of file nandflash.c.

#define ESC_CHAR   27

Definition at line 81 of file nandflash.c.

#define PAGE_INDEX   0

Definition at line 72 of file nandflash.c.

Function Documentation

bool checkBadBlock ( uint32_t  block)

Definition at line 172 of file nandflash.c.

int main ( void  )

Main routine for example_nandflash.

Main program body.

Returns
Nothing

Definition at line 190 of file nandflash.c.

static uint32_t MakeString ( uint8_t *  str)
static

Definition at line 117 of file nandflash.c.

static void ShowString ( char *  str)
static

Definition at line 91 of file nandflash.c.

STATIC void waitForReady ( void  )

Definition at line 163 of file nandflash.c.

Variable Documentation

uint32_t buffer[BUFFER_SIZE/sizeof(uint32_t)]

Definition at line 84 of file nandflash.c.