![]() |
nandps
Vitis Drivers API Documentation
|
This file contains a design example using the NAND driver (XNandPs).
This example tests the block erase, block read and block write features. The flash blocks are erased and written. The data is read back and compared with the data written for correctness. The bad blocks are not erased/programmed.
None.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00 nm 12/10/2010 First release. 1.01a nm 28/02/2012 Modified the test offsets. ms 04/10/17 Modified Comment lines to follow doxygen rules 2.8 akm 07/06/23 Add support for system device-tree flow.
Macros | |
#define | NAND_TEST_START_BLOCK 64 |
Starting block to test. More... | |
#define | NAND_TEST_NUM_BLOCKS 16 |
Number of blocks to test. More... | |
#define | NAND_TEST_BLOCK_SIZE 0x20000 |
Test Block Size, must be same as the flash block size. More... | |
Functions | |
int | NandReadWriteExample (u32 NandDeviceId) |
This function runs a test on the NAND flash device using the basic driver functions. More... | |
int | main (void) |
Main function to execute the Nand Flash read write example. More... | |
Variables | |
u8 | ReadBuffer [NAND_TEST_BLOCK_SIZE] |
Block sized Read buffer. More... | |
u8 | WriteBuffer [NAND_TEST_BLOCK_SIZE] |
Block sized write buffer. More... | |
#define NAND_TEST_BLOCK_SIZE 0x20000 |
Test Block Size, must be same as the flash block size.
Referenced by NandReadWriteExample().
#define NAND_TEST_NUM_BLOCKS 16 |
Number of blocks to test.
Referenced by NandReadWriteExample().
#define NAND_TEST_START_BLOCK 64 |
Starting block to test.
Referenced by NandReadWriteExample().
int main | ( | void | ) |
Main function to execute the Nand Flash read write example.
References NandReadWriteExample().
int NandReadWriteExample | ( | u32 | NandDeviceId | ) |
This function runs a test on the NAND flash device using the basic driver functions.
The function does the following tasks:
NandDeviceId | is is the XPAR_<NAND_instance>_DEVICE_ID value from xparameters.h. |
References XNandPs_Geometry::BlockSize, XNandPs_Config::FlashBase, XNandPsTag::Geometry, NAND_TEST_BLOCK_SIZE, NAND_TEST_NUM_BLOCKS, NAND_TEST_START_BLOCK, ReadBuffer, XNandPs_Config::SmcBase, WriteBuffer, XNandPs_CfgInitialize(), XNandPs_EraseBlock(), XNandPs_IsBlockBad(), XNandPs_LookupConfig(), XNandPs_Read(), and XNandPs_Write().
Referenced by main().
u8 ReadBuffer[NAND_TEST_BLOCK_SIZE] |
Block sized Read buffer.
u8 WriteBuffer[NAND_TEST_BLOCK_SIZE] |
Block sized write buffer.