uboot烧写命令--yaffs、jiffs和ubifs

  • 如果要烧写的镜像的格式是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 0 offset 0x0, size 0x1a29740
data abort
pc : [<8081c2a0>]          lr : [<8081c288>]
sp : 8079e448  ip : 00000008     fp : 8083edd0
r10: 01a29740  r9 : 80844340     r8 : 8079ffe0
r7 : 00000000  r6 : 00000001     r5 : 825363b2  r4 : 00000800
r3 : 8083fd78  r2 : 00000000     r1 : 8083b5b4  r0 : 00000000
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

如果是4字节对齐:

hisilicon # setenv ethaddr 40:61:86:06:33:66;setenv serverip 192.168.253.129;setenv ipaddr 192.168.253.130;
hisilicon # mw.b 0x82000000 ff 2200000; tftp 0x82000000 rootfs.img;nand write.yaffs 0x82000000 0x0 0x1a29740
No such device: 0:2
No such device: 0:2
MAC:   40-61-86-06-33-66
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 = 27432768 (1a29740 hex)

NAND write: device 0 offset 0x0, size 0x1a29740
pure data length is 26601472, len_incl_bad is 26607616

 27432768 bytes written: OK

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

 sf write 0x8276BE52  0x0 0x200000

  • 如果要烧写的镜像格式是jiffs或者ubifs,可以用nand write
原文地址:https://www.cnblogs.com/pengdonglin137/p/3284215.html