硬件平台:AT91SAM9260EK
NandFlash型号:s34ML02G100TFI00
1、准备BootStrap源码、配置交叉工具链:
BootStarp源码地址:ftp://www.at91.com/pub/at91bootstrap/
使用工具链:arm-2006q3
解压源码、配置交叉工具链
2、根据NandFlash型号与参数修改nand_ids.h文件:
a) 根据板子上的nandflash型号为s34ML02G100TFI00,查看其datasheet;
b) 在 ./include/nand_ids.h 中找到static struct SNandInitInfo NandFlash_InitInfo[],在内容中增加:
{0x01da, 0x800, 0x20000, 0x800, 0x40, 0x0, "s34ML02G100TFI00\0"}
【以上内容分别代表:芯片ID、芯片块数、每块的有效字节、每页的有效字节、每页的空闲字节、总线宽度】
在同目录nandflash.h下可看到相关定义如下:
typedef struct SNandInitInfo
41 {
42 unsigned int uNandID ; /* Nand Chip ID */
43 unsigned int uNandNbBlocks ;
44 unsigned int uNandBlockSize ;
45 unsigned int uNandSectorSize ;
46 unsigned int uNandSpareSize ;
47 unsigned int uNandBusWidth ;
48 char name[40] ; /* Nand Name */
49 } SNandInitInfo, *PSNandInitInfo;
3、根据平台型号进入对应目录,进行Makefile修改,编译:
a) 平台是at91sam9260,因此进入目录./board/at91sam9260ek/nandflash,定义Makefile的交叉编译路径:CROSS_COMPILE=arm-none-eabi-
b) 在同目录下执行 ./make