当前位置: 技术问答>linux和unix
uboot下环境变量的忽有忽无
来源: 互联网 发布时间:2016-05-26
本文导语: 9260的芯片,测试中突然出现了一个问题。就是uboot启动的时候会报错。 好像uboot存在flash上的数据不稳定。 如下: U-Boot 1.1.5 (Mar 3 2009 - 10:37:59) DRAM: 64 MB MAN_ID: 0x00bf PRO_ID: 0x236d Flash: 8 MB NAND: NAND device:...
9260的芯片,测试中突然出现了一个问题。就是uboot启动的时候会报错。
好像uboot存在flash上的数据不稳定。
如下:
U-Boot 1.1.5 (Mar 3 2009 - 10:37:59)
DRAM: 64 MB
MAN_ID: 0x00bf
PRO_ID: 0x236d
Flash: 8 MB
NAND: NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (/狺掰掰?NAND 64
MiB 3,3V 8-bit)
64 MiB
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
PHY Detected (mdio-addr 1, ID 0x0013:0x78e2)
link up, 100Mbps, full-duplex
Hit any key to stop autoboot: 0
## Booting image at 20400000 ...
Image Name: linux-2.6
Image Type: ARM Linux Kernel Image (gzip compressed)
Data Size: 1144342 Bytes = 1.1 MB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... Bad Data CRC
U-Boot>
然后我在uboot下输入run fo_kernel;run boot就可以正常启动linux。
U-Boot> printenv
bootcmd=run fo_kernel;run boot
bootdelay=3
baudrate=115200
ethaddr=20:00:00:00:00:00
ipaddr=192.168.0.251
serverip=192.168.0.133
gatewayip=192.168.0.1
netmask=255.255.255.0
hostname=SBC9260
kernel_nor=10050000
kernel_ram=20400000
kernel_size=00200000
boot=bootm ${kernel_ram}
fo_kernel=cp.b ${kernel_nor} ${kernel_ram} ${kernel_size}
stdin=serial
stdout=serial
stderr=serial
Environment size: 375/65532 bytes
U-Boot> run fo_kernel;run boot
## Booting image at 20400000 ...
Image Name: linux-2.6
Image Type: ARM Linux Kernel Image (gzip compressed)
Data Size: 1144342 Bytes = 1.1 MB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting kernel ...
..........省略..............
[root@sbc9260 /]#
请教一下,能否帮我们看看,这个可能的问题点在哪里?
还有就是在uboot下设置环境变量的时候,这个变量的值在多次读取的时候会不一样。
以下是环境变量保存后的地址,用md显示的情况,如下:
U-Boot> md 0x10040000
10040000: 5df9da88 746f6f62 3d646d63 206e7572 ...]bootcmd=run
10040010: 6b5f6f66 656e7265 75723b6c 6f62206e fo_kernel;run bo
10040020: 6200746f 64746f6f 79616c65 6200333d ot.bootdelay=3.b
10040030: 72647561 3d657461 32353131 65003030 audrate=115200.e
10040040: 64616874 323d7264 30303a30 3a30303a thaddr=20:00:00:
10040050: 303a3030 30303a30 74656e00 6b73616d 00:00:00.netmask
10040060: 3535323d 3535322e 3535322e 6800302e =255.255.255.0.h
10040070: 6e74736f 3d656d61 39434253 00303632 ostname=SBC9260.
10040080: 6e72656b 6e5f6c65 313d726f 30353030 kernel_nor=10050
10040090: 00303030 6e72656b 725f6c65 323d6d61 000.kernel_ram=2
100400a0: 30303430 00303030 6e72656b 735f6c65 0400000.kernel_s
100400b0: 3d657a69 30323030 30303030 6f6f6200 ize=00200000.boo
100400c0: 6f623d74 206d746f 656b7b24 6c656e72 t=bootm ${kernel
100400d0: 6d61725f 6f66007d 72656b5f 3d6c656e _ram}.fo_kernel=
100400e0: 622e7063 6b7b2420 656e7265 6f6e5f6c cp.b ${kernel_no
100400f0: 24207d72 72656b7b 5f6c656e 7d6d6172 r} ${kernel_ram}
10040100: 6b7b2420 656e7265 69735f6c 007d657a ${kernel_size}.
10040110: 69647473 65733d6e 6c616972 64747300 stdin=serial.std
10040120: 3d74756f 69726573 73006c61 72656474 out=serial.stder
10040130: 65733d72 6c616972 72657300 69726576 r=serial.serveri
10040140: 39313d70 36312e32 2e362e38 67003637 p=192.168.6.76.g
10040150: 77657461 70697961 3239313d 3836312e atewayip=192.168
10040160: 312e362e 61706900 3d726464 2e323931 .6.1.ipaddr=192.
10040170: 2e383631 34312e36 00000035 00000000 168.6.145.......
10040180: 00000000 00000000 00000000 00000000 ................
10040190: 00000000 00000000 00000000 00000000 ................
U-Boot> printenv
bootcmd=run fo_kernel;run boot
bootdelay=3
baudrate=115200
ethaddr=20:00:00:00:00:00
ipaddr=192.168.0.251
serverip=192.168.0.133
gatewayip=192.168.0.1
netmask=255.255.255.0
hostname=SBC9260
kernel_nor=10050000
kernel_ram=20400000
kernel_size=00200000
boot=bootm ${kernel_ram}
fo_kernel=cp.b ${kernel_nor} ${kernel_ram} ${kernel_size}
stdin=serial
stdout=serial
stderr=serial
Environment size: 375/65532 bytes
U-Boot> md 0x10040000
10040000: 5df9da88 746f6f62 3d646d63 206e7572 ...]bootcmd=run
10040010: 6b5f6f66 656e7265 75723b6c 6f62206e fo_kernel;run bo
10040020: 6200746f 64746f6f 79616c65 6200333d ot.bootdelay=3.b
10040030: 72647561 3d657461 32350000 65003000 audrate=..52.0.e
10040040: 64616874 323d7264 30303a30 3a300000 thaddr=20:00..0:
10040050: 00000000 00000000 00000000 00000000 ................
10040060: 3535323d 3535322e 3535322e 6800302e =255.255.255.0.h
10040070: 00000000 00000000 00000000 00000000 ................
10040080: 6e72656b 6e5f6c65 313d726f 30353030 kernel_nor=10050
10040090: 00303030 6e72656b 725f6c65 323d6d61 000.kernel_ram=2
100400a0: 30303430 00303030 6e72656b 735f6c65 0400000.kernel_s
100400b0: 3d657a69 30323030 30303030 6f6f6200 ize=00200000.boo
100400c0: 6f623d74 206d6000 656b0000 6c650000 t=bo.`m ..ke..el
100400d0: 6d610000 00000000 72650000 3d6c0000 ..am......er..l=
100400e0: 00000000 00000000 00000000 00000000 ................
100400f0: 00000000 00000000 00000000 00000000 ................
10040100: 00000000 00000000 00000000 00000000 ................
10040110: 00000000 00000000 00000000 00000000 ................
10040120: 00000000 00000000 00000000 00000000 ................
10040130: 00000000 00000000 00000000 00000000 ................
10040140: 00000000 00000000 00000000 00000000 ................
10040150: 00000000 00000000 00000000 00000000 ................
10040160: 00000000 00000000 00000000 00000000 ................
10040170: 2e383631 34312e36 00000035 00000000 168.6.145.......
10040180: 00000000 00000000 00000000 00000000 ................
10040190: 00000000 00000000 00000000 00000000 ................
U-Boot> md 0x10040000
10040000: 5df9da88 746f6f62 3d646d63 206e7572 ...]bootcmd=run
10040010: 6b5f6f66 656e7265 75723b6c 6f62206e fo_kernel;run bo
10040020: 6200746f 64746f6f 79616c65 6200333d ot.bootdelay=3.b
10040030: 72647561 3d657461 32353131 65003030 audrate=115200.e
10040040: 64616874 323d7264 30303a30 3a30303a thaddr=20:00:00:
10040050: 303a3030 30303a30 74650000 6b730000 00:00:00..et..sk
10040060: 00000000 00000000 00000000 00000000 ................
10040070: 00000000 00000000 00000000 00000000 ................
10040080: 00000000 00000000 00000000 00000000 ................
10040090: 00000000 00000000 00000000 00000000 ................
100400a0: 00000000 00000000 00000000 00000000 ................
100400b0: 00000000 00000000 00000000 00000000 ................
100400c0: 00000000 00000000 00000000 00000000 ................
U-Boot> md 0x10040000
10040000: 00000000 00000000 00000000 00000000 ................
10040010: 00000000 00000000 00000000 00000000 ................
10040020: 00000000 00000000 00000000 00000000 ................
10040030: 00000000 00000000 00000000 00000000 ................
10040040: 00000000 00000000 00000000 00000000 ................
10040050: 00000000 00000000 00000000 00000000 ................
10040060: 00000000 00000000 00000000 00000000 ................
10040070: 00000000 00000000 00000000 00000000 ................
10040080: 00000000 00000000 00000000 00000000 ................
10040090: 00000000 00000000 00000000 00000000 ................
100400a0: 00000000 00000000 00000000 00000000 ................
100400b0: 00000000 00000000 00000000 00000000 ................
100400c0: 00000000 00000000 00000000 00000000 ................
100400d0: 00000000 00000000 00000000 00000000 ................
100400e0: 00000000 00000000 00000000 00000000 ................
U-Boot>
真是不好意思,打扰,请帮高手指点以下。谢谢!
好像uboot存在flash上的数据不稳定。
如下:
U-Boot 1.1.5 (Mar 3 2009 - 10:37:59)
DRAM: 64 MB
MAN_ID: 0x00bf
PRO_ID: 0x236d
Flash: 8 MB
NAND: NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (/狺掰掰?NAND 64
MiB 3,3V 8-bit)
64 MiB
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
PHY Detected (mdio-addr 1, ID 0x0013:0x78e2)
link up, 100Mbps, full-duplex
Hit any key to stop autoboot: 0
## Booting image at 20400000 ...
Image Name: linux-2.6
Image Type: ARM Linux Kernel Image (gzip compressed)
Data Size: 1144342 Bytes = 1.1 MB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... Bad Data CRC
U-Boot>
然后我在uboot下输入run fo_kernel;run boot就可以正常启动linux。
U-Boot> printenv
bootcmd=run fo_kernel;run boot
bootdelay=3
baudrate=115200
ethaddr=20:00:00:00:00:00
ipaddr=192.168.0.251
serverip=192.168.0.133
gatewayip=192.168.0.1
netmask=255.255.255.0
hostname=SBC9260
kernel_nor=10050000
kernel_ram=20400000
kernel_size=00200000
boot=bootm ${kernel_ram}
fo_kernel=cp.b ${kernel_nor} ${kernel_ram} ${kernel_size}
stdin=serial
stdout=serial
stderr=serial
Environment size: 375/65532 bytes
U-Boot> run fo_kernel;run boot
## Booting image at 20400000 ...
Image Name: linux-2.6
Image Type: ARM Linux Kernel Image (gzip compressed)
Data Size: 1144342 Bytes = 1.1 MB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting kernel ...
..........省略..............
[root@sbc9260 /]#
请教一下,能否帮我们看看,这个可能的问题点在哪里?
还有就是在uboot下设置环境变量的时候,这个变量的值在多次读取的时候会不一样。
以下是环境变量保存后的地址,用md显示的情况,如下:
U-Boot> md 0x10040000
10040000: 5df9da88 746f6f62 3d646d63 206e7572 ...]bootcmd=run
10040010: 6b5f6f66 656e7265 75723b6c 6f62206e fo_kernel;run bo
10040020: 6200746f 64746f6f 79616c65 6200333d ot.bootdelay=3.b
10040030: 72647561 3d657461 32353131 65003030 audrate=115200.e
10040040: 64616874 323d7264 30303a30 3a30303a thaddr=20:00:00:
10040050: 303a3030 30303a30 74656e00 6b73616d 00:00:00.netmask
10040060: 3535323d 3535322e 3535322e 6800302e =255.255.255.0.h
10040070: 6e74736f 3d656d61 39434253 00303632 ostname=SBC9260.
10040080: 6e72656b 6e5f6c65 313d726f 30353030 kernel_nor=10050
10040090: 00303030 6e72656b 725f6c65 323d6d61 000.kernel_ram=2
100400a0: 30303430 00303030 6e72656b 735f6c65 0400000.kernel_s
100400b0: 3d657a69 30323030 30303030 6f6f6200 ize=00200000.boo
100400c0: 6f623d74 206d746f 656b7b24 6c656e72 t=bootm ${kernel
100400d0: 6d61725f 6f66007d 72656b5f 3d6c656e _ram}.fo_kernel=
100400e0: 622e7063 6b7b2420 656e7265 6f6e5f6c cp.b ${kernel_no
100400f0: 24207d72 72656b7b 5f6c656e 7d6d6172 r} ${kernel_ram}
10040100: 6b7b2420 656e7265 69735f6c 007d657a ${kernel_size}.
10040110: 69647473 65733d6e 6c616972 64747300 stdin=serial.std
10040120: 3d74756f 69726573 73006c61 72656474 out=serial.stder
10040130: 65733d72 6c616972 72657300 69726576 r=serial.serveri
10040140: 39313d70 36312e32 2e362e38 67003637 p=192.168.6.76.g
10040150: 77657461 70697961 3239313d 3836312e atewayip=192.168
10040160: 312e362e 61706900 3d726464 2e323931 .6.1.ipaddr=192.
10040170: 2e383631 34312e36 00000035 00000000 168.6.145.......
10040180: 00000000 00000000 00000000 00000000 ................
10040190: 00000000 00000000 00000000 00000000 ................
U-Boot> printenv
bootcmd=run fo_kernel;run boot
bootdelay=3
baudrate=115200
ethaddr=20:00:00:00:00:00
ipaddr=192.168.0.251
serverip=192.168.0.133
gatewayip=192.168.0.1
netmask=255.255.255.0
hostname=SBC9260
kernel_nor=10050000
kernel_ram=20400000
kernel_size=00200000
boot=bootm ${kernel_ram}
fo_kernel=cp.b ${kernel_nor} ${kernel_ram} ${kernel_size}
stdin=serial
stdout=serial
stderr=serial
Environment size: 375/65532 bytes
U-Boot> md 0x10040000
10040000: 5df9da88 746f6f62 3d646d63 206e7572 ...]bootcmd=run
10040010: 6b5f6f66 656e7265 75723b6c 6f62206e fo_kernel;run bo
10040020: 6200746f 64746f6f 79616c65 6200333d ot.bootdelay=3.b
10040030: 72647561 3d657461 32350000 65003000 audrate=..52.0.e
10040040: 64616874 323d7264 30303a30 3a300000 thaddr=20:00..0:
10040050: 00000000 00000000 00000000 00000000 ................
10040060: 3535323d 3535322e 3535322e 6800302e =255.255.255.0.h
10040070: 00000000 00000000 00000000 00000000 ................
10040080: 6e72656b 6e5f6c65 313d726f 30353030 kernel_nor=10050
10040090: 00303030 6e72656b 725f6c65 323d6d61 000.kernel_ram=2
100400a0: 30303430 00303030 6e72656b 735f6c65 0400000.kernel_s
100400b0: 3d657a69 30323030 30303030 6f6f6200 ize=00200000.boo
100400c0: 6f623d74 206d6000 656b0000 6c650000 t=bo.`m ..ke..el
100400d0: 6d610000 00000000 72650000 3d6c0000 ..am......er..l=
100400e0: 00000000 00000000 00000000 00000000 ................
100400f0: 00000000 00000000 00000000 00000000 ................
10040100: 00000000 00000000 00000000 00000000 ................
10040110: 00000000 00000000 00000000 00000000 ................
10040120: 00000000 00000000 00000000 00000000 ................
10040130: 00000000 00000000 00000000 00000000 ................
10040140: 00000000 00000000 00000000 00000000 ................
10040150: 00000000 00000000 00000000 00000000 ................
10040160: 00000000 00000000 00000000 00000000 ................
10040170: 2e383631 34312e36 00000035 00000000 168.6.145.......
10040180: 00000000 00000000 00000000 00000000 ................
10040190: 00000000 00000000 00000000 00000000 ................
U-Boot> md 0x10040000
10040000: 5df9da88 746f6f62 3d646d63 206e7572 ...]bootcmd=run
10040010: 6b5f6f66 656e7265 75723b6c 6f62206e fo_kernel;run bo
10040020: 6200746f 64746f6f 79616c65 6200333d ot.bootdelay=3.b
10040030: 72647561 3d657461 32353131 65003030 audrate=115200.e
10040040: 64616874 323d7264 30303a30 3a30303a thaddr=20:00:00:
10040050: 303a3030 30303a30 74650000 6b730000 00:00:00..et..sk
10040060: 00000000 00000000 00000000 00000000 ................
10040070: 00000000 00000000 00000000 00000000 ................
10040080: 00000000 00000000 00000000 00000000 ................
10040090: 00000000 00000000 00000000 00000000 ................
100400a0: 00000000 00000000 00000000 00000000 ................
100400b0: 00000000 00000000 00000000 00000000 ................
100400c0: 00000000 00000000 00000000 00000000 ................
U-Boot> md 0x10040000
10040000: 00000000 00000000 00000000 00000000 ................
10040010: 00000000 00000000 00000000 00000000 ................
10040020: 00000000 00000000 00000000 00000000 ................
10040030: 00000000 00000000 00000000 00000000 ................
10040040: 00000000 00000000 00000000 00000000 ................
10040050: 00000000 00000000 00000000 00000000 ................
10040060: 00000000 00000000 00000000 00000000 ................
10040070: 00000000 00000000 00000000 00000000 ................
10040080: 00000000 00000000 00000000 00000000 ................
10040090: 00000000 00000000 00000000 00000000 ................
100400a0: 00000000 00000000 00000000 00000000 ................
100400b0: 00000000 00000000 00000000 00000000 ................
100400c0: 00000000 00000000 00000000 00000000 ................
100400d0: 00000000 00000000 00000000 00000000 ................
100400e0: 00000000 00000000 00000000 00000000 ................
U-Boot>
真是不好意思,打扰,请帮高手指点以下。谢谢!
|
*** Warning - bad CRC, using default environment
重新设置下环境量,可能是flash坏块引起的
重新设置下环境量,可能是flash坏块引起的
|
帮up下