4.7 NAND Flash
This example demonstrates how to use the Linux API to erase, write, and read
NAND Flash on the development board,please refer to the source code for detail.
Hardware Preparation:
Hardware debugging environment to see chapter second.
MYD-AM335X series development board.
Software Preparation:
Linux Kernel 4.1.18
mtd_test application
Test Steps:
Copy cross compiled
<WORKDIR>/Examples/mtd/mtd_test
to
/usr/bin
directory of the
MYD-AM335x series development board,Executing the following command to
nandflash erase, write and read data:
# ./mtd_test /dev/mtd7
MTD Type:
4
MTD total size:
131072
bytes
MTD erase size:
131072
bytes
MTD write size:
2048
bytes
erase the last block at
0
erase done!
writing
16
bytes data to flash...
0x00
0x01
0x02
0x03
0x04
0x05
0x06
0x07
0x08
0x09
0x0a
0x0b
0x0c
0x0d
0x0e
0x0f
write done!
reading data from flash...
0x00
0x01
0x02
0x03
0x04
0x05
0x06
0x07
0x08
0x09
0x0a
0x0b
0x0c
0x0d
0x0e
0x0f
read done!
46