用tftp在u_boot下烧写uImage到Nand Flash(参考申嵌入的)
将uImage拷贝至/tftpboot/
在SecureCRT中依次输入:
SMDK2440A>tftp 0x30008000 uImage //把uImage 写到内存的0x3000 8000开始的单元里 掉电后就没有的啦
SMDK2440A>nand erase 60000 500000 //擦除 nandflash中以0x6000单元开始的大小为0x50 0000(即5M存储空间 其实内核才2M多点)
SMDK2440A>nand write 0x30008000 0x60000 0x50 0000
//把内存中0x3000 8000单元开始的大小为0x50 0000内容写到 nandflash中以0x 6 0000单元开始的存储空间中 (掉电后,还是有的)
实验执行过程及结果:
[u-boot@SMDK2440A]# printenv
bootargs=console=ttySAC0 root=/dev/nfs nfsroot=192.168.1.72:/opt/rootfs ip=192.168.1.226:192.168.1.72:192.168.1.72:255.255.255.0:smdk2440a.embedclub.com:eth0:off
bootcmd=nand read 0x30008000 60000 500000;bootm 0x30008000
bootdelay=1
baudrate=115200
ethaddr=08:08:11:18:12:27
netmask=255.255.255.0
embedclub=bmp d 70000
stdin=serial
stdout=serial
stderr=serial
lcdtype=w
ethact=dm9000
serverip=192.168.1.108
ipaddr=192.168.1.266
gatewayip=192.168.1.1
Environment size: 451/131068 bytes
[u-boot@SMDK2440A]# tftp 30008000 uImage
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 192.168.1.108; our IP address is 192.168.1.10
Filename 'uImage'.
Load address: 0x30008000
Loading: T #################################################################
#################################################################
##########################
done
Bytes transferred = 2286828 (22e4ec hex)
[u-boot@SMDK2440A]# nand erase 60000 500000
NAND erase: device 0 offset 0x60000, size 0x500000
Erasing at 0x54000002800000 -- 0% complete.
OK
[u-boot@SMDK2440A]# nand write 30008000 60000 500000
NAND write: device 0 offset 0x60000, size 0x500000
Writing at 0x54000000020000 -- 100% is complete. 5242880 bytes written: OK
[u-boot@SMDK2440A]#boot //启动 成功的啦