• 如果要烧写的镜像的格式是yaffs2或者yaffs格式的,那么在往Nand Flash中烧写该镜像是必须采用nand write.yaffs,而不能采用nand write:

    nand write.yaffs 0x82000000  0    13cb00

将内存地址0x82000000处的内容写到Nand Flash起始地址为0的地方,烧写大小为13cb00

    注意:烧写的大小应该为镜像的实际大小

  • 其中内存的地址(在本例中是0x82000000)必须要4字节对齐,否则会出现如下错误:
nand write.yaffs 0x825363b2 0x0 0x1a29740

NAND write: device  offset 0x0, size 0x1a29740
data abort
pc : [<8081c2a0>] lr : [<8081c288>]
sp : 8079e448 ip : fp : 8083edd0
r10: 01a29740 r9 : r8 : 8079ffe0
r7 : r6 : r5 : 825363b2 r4 :
r3 : 8083fd78 r2 : r1 : 8083b5b4 r0 :
Flags: nZCv IRQs off FIQs off Mode SVC_32
Resetting CPU ... resetting ...

如果是4字节对齐:

hisilicon # setenv ethaddr :::::;setenv serverip 192.168.253.129;setenv ipaddr 192.168.253.130;
hisilicon # mw.b 0x82000000 ff ; tftp 0x82000000 rootfs.img;nand write.yaffs 0x82000000 0x0 0x1a29740
No such device: :
No such device: :
MAC: -----
TFTP from server 192.168.253.129; our IP address is 192.168.253.130
Download Filename 'rootfs.img'.
Download to address: 0x82000000
Downloading: #################################################
done
Bytes transferred = (1a29740 hex) NAND write: device offset 0x0, size 0x1a29740
pure data length is , len_incl_bad is bytes written: OK

但是对于SPI flash并无此要求,即下面的命令可以正确执行:

sf write 0x8276BE52  0x0 0x200000

  • 如果要烧写的镜像格式是jiffs或者ubifs,可以用nand write
05-11 19:19