本文主要是介绍新路程------uboot环境变量没生效,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
之前刷文件系统一种出错,出错log如下
hisilicon # sf probe 0;mw.b 0x82000000 0xff 0x1800000;tftp 0x82000000 rootfs_ucl
ibc_64k.jffs2;sf erase 0x500000 0x1800000;sf write 0x82000000 0x500000 0x1800000
32768 KiB hi_sfc at 0:0 is now current device
ETH0: PHY(phyaddr=1, rmii) link UP: DUPLEX=FULL : SPEED=100M
MAC: 00-00-23-34-45-66
TFTP from server 192.168.1.1; our IP address is 192.168.1.155
Download Filename 'rootfs_uclibc_64k.jffs2'.
Download to address: 0x82000000
Downloading: #################################################
done
Bytes transferred = 12178136 (b9d2d8 hex)
Erasing at 0x1d00000 -- 100% complete.
Writing at 0x1d00000 -- 100% complete.
hisilicon # saveenv
Saving Environment to SPI Flash...
Erasing SPI flash, offset 0x00080000 size 256K ...done
Writing to SPI flash, offset 0x00080000 size 256K ...done
hisilicon #
hisilicon # bootm
Wrong Image Format for bootm command
ERROR: can't get kernel image!
而且用
reset也一样的错误
结果认真一检查,发现参数不对,没加‘单引号,引以为戒。
本来是这样set bootargs mem=64M console=ttyAMA0,115200n8 mtdparts=hi_sfc:1M(uboot),4M(kernel),24M(root),3M(data) root=/dev/mtdblock2 rootfstype=jffs2
set bootcmd sf probe 0;sf read 0x82000000 0x100000 0x400000\;bootm 0x82000000
现在是
set bootargs 'mem=64M console=ttyAMA0,115200n8 mtdparts=hi_sfc:1M(uboot),4M(kernel),24M(root),3M(data) root=/dev/mtdblock2 rootfstype=jffs2'
set bootcmd 'sf probe 0;sf read 0x82000000 0x100000 0x400000\;bootm 0x82000000'
查看0x82000000地址的内容
hisilicon # md 0x82000000
82000000: 56190527 de38bd8c b46c9e59 a0ca3100 '..V..8.Y.l..1..
82000010: 00800080 00800080 3a4c8930 00020205 ........0.L:....
82000020: 756e694c 2e332d78 35332e34 00000000 Linux-3.4.35....
82000030: 00000000 00000000 00000000 00000000 ................
82000040: e1a00000 e1a00000 e1a00000 e1a00000 ................
82000050: e1a00000 e1a00000 e1a00000 e1a00000 ................
82000060: ea000002 016f2818 00000000 0031caa0 .....(o.......1.
82000070: e1a07001 e1a08002 e10f2000 e3120003 .p....... ......
82000080: 1a000001 e3a00017 ef123456 e10f2000 ........V4... ..
82000090: e38220c0 e121f002 00000000 00000000 . ....!.........
820000a0: e59f47a4 ee110f30 e3800040 ee010f30 .G..0...@...0...
820000b0: eb00005a e28f0f4a e8901c4e e590d01c Z...J...N.......
820000c0: e0400001 e0866000 e08aa000 e5da9000 ..@..`..........
820000d0: e5dae001 e189940e e5dae002 e5daa003 ................
820000e0: e189980e e1899c0a e08dd000 e28da801 ................
820000f0: e3a05000 e28aa901 e154000a 2a000016 .P........T....*
所以其实问题的关键在于,如果先烧kernel再烧文件系统,虽然已经将文件系统从内存的0x82000000这个地方写到spi flash里了,但是bootm又从0x82000000这个地方启动,本来这里就是文件系统在内存里的位置,当然读不到内核了
所以正确的方式应该是
如果单独烧内核,bootm 0x82000000可以生效
但是如果要烧文件系统,只能reset,因为内存里的0x8200这个地方已经变了
这篇关于新路程------uboot环境变量没生效的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!