主题 : uboot烧写内核问题 复制链接 | 浏览器收藏 | 打印
级别: 侠客
UID: 5629
精华: 0
发帖: 74
金钱: 755 两
威望: 496 点
贡献值: 0 点
综合积分: 148 分
注册时间: 2009-05-01
最后登录: 2012-03-16
楼主  发表于: 2009-09-15 09:20

 uboot烧写内核问题

管理提醒: 本帖被 arm9home 从 Linux技术交流专区 移动到本区(2010-02-08)
我想做的是gdyzlxc老兄的(U盘文件系统制作方法) http://www.aiothome.com/bbs/read.php?tid-2959-fpage-2.html
用的uboot和参考的方法是hugerat 老兄的 http://blog.chinaunix.net/u2/75270/showart_1836713.html

内核是1.94M,
在u-boot提示符下输入了: set bootcmd 'nand read 0x31000000 0x50000 0x00250000;bootm 0x31000000'
又输入saveenv保存参数。打开TFTP服务器。
在u-boot下输入tftp 0x30000000 uImage,成功下载uImage到内存中了。
又输入nand erase 0x50000 0x250000删除掉kernel空间原有的数据。
然后输入nand write 0x30000000 0x50000 0x250000,将内存中的kernel烧入nand flash。

启动后显示如下
NAND read: device 0 offset 0x50000, size 0x250000
2424832 bytes read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!

不知道是不是这个设定的错set bootcmd 'nand read 0x31000000 0x50000 0x00250000;bootm 0x31000000'
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-09-15 09:32
在你执行完nand write 0x30000000 0x50000 0x250000后执行
nand read 0x31000000 0x50000 0x00250000
md 0x31000000
看看从读出来的NAND Flash中读出来的数据和你写进去uImage的是否一致
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 侠客
UID: 5629
精华: 0
发帖: 74
金钱: 755 两
威望: 496 点
贡献值: 0 点
综合积分: 148 分
注册时间: 2009-05-01
最后登录: 2012-03-16
2楼  发表于: 2009-09-15 09:43

 回 1楼(kasim) 的帖子

执行后如下,
mini2440 # nand read 0x31000000 0x50000 0x00250000

NAND read: device 0 offset 0x50000, size 0x250000
2424832 bytes read: OK
mini2440 # md 0x31000000
31000000: 00000000 00000000 00000000 00000000    ................
31000010: 00000000 00000000 00000000 00000000    ................
31000020: 00000000 00000000 00000000 00000000    ................
31000030: 00000000 00000000 00000000 00000000    ................
31000040: 00000000 00000000 00000000 00000000    ................
31000050: 00000000 00000000 00000000 00000000    ................
31000060: 00000000 00000000 00000000 00000000    ................
31000070: 00000000 00000000 00000000 00000000    ................
31000080: 00000000 00000000 00000000 00000000    ................
31000090: 00000000 00000000 00000000 00000000    ................
310000a0: 00000000 00000000 00000000 00000000    ................
310000b0: 00000000 00000000 00000000 00000000    ................
310000c0: 00000000 00000000 00000000 00000000    ................
310000d0: 00000000 00000000 00000000 00000000    ................
310000e0: 00000000 00000000 00000000 00000000    ................
310000f0: 00000000 00000000 00000000 00000000    ................
mini2440 #
级别: 侠客
UID: 5629
精华: 0
发帖: 74
金钱: 755 两
威望: 496 点
贡献值: 0 点
综合积分: 148 分
注册时间: 2009-05-01
最后登录: 2012-03-16
3楼  发表于: 2009-09-15 09:46
执行md 0x30000000时,显示如下,是不是set bootcmd 'nand read 0x31000000 0x50000 0x00250000;bootm 0x31000000'
中后面的bootm 0x31000000'改成bootm 0x30000000'呀?

mini2440 # md 0x30000000
30000000: 00000000 00000000 00000008 00000000    ................
30000010: 00000000 08000000 00800000 00000000    ................
30000020: 80000000 00500000 00000000 40040000    ......P........@
30000030: 00000000 00000000 00000000 04000000    ................
30000040: 10840100 00000000 00180000 42000000    ...............B
30000050: 00000000 00100000 00000000 00000000    ................
30000060: 00000000 00000000 00020000 08000000    ................
30000070: 00000000 00000000 00000000 08000800    ................
30000080: 00000000 00400000 00000000 00000000    ......@.........
30000090: 40010000 00000000 80000000 00004000    ...@.........@..
300000a0: 00000000 00000000 08000000 00000000    ................
300000b0: 00000000 00490000 00000000 80000000    ......I.........
300000c0: 00000000 00800000 00000000 00000000    ................
300000d0: 04000000 00000000 00020000 08000200    ................
300000e0: 00000002 00100000 00000000 00000000    ................
300000f0: 00000000 00000000 00100000 00000000    ................
mini2440 #
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2009-09-15 10:15

 Re:回 1楼(kasim) 的帖子

引用第2楼qwer1251于2009-09-15 09:43发表的 回 1楼(kasim) 的帖子 :
执行后如下,
mini2440 # nand read 0x31000000 0x50000 0x00250000

NAND read: device 0 offset 0x50000, size 0x250000
2424832 bytes read: OK
.......

这说明这个时候uboot从NAND Flash offset 0x50000处读出来的不是期待的uImage的数据。原因只有两个:
1. uImage数据没有正确写入NAND Flash;
2. 写入正确,但读取过程不正确。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 侠客
UID: 5629
精华: 0
发帖: 74
金钱: 755 两
威望: 496 点
贡献值: 0 点
综合积分: 148 分
注册时间: 2009-05-01
最后登录: 2012-03-16
5楼  发表于: 2009-09-15 10:23

 回 4楼(kasim) 的帖子

谢谢指导,我在去鼓捣鼓捣去。
级别: 侠客
UID: 5629
精华: 0
发帖: 74
金钱: 755 两
威望: 496 点
贡献值: 0 点
综合积分: 148 分
注册时间: 2009-05-01
最后登录: 2012-03-16
6楼  发表于: 2009-09-15 10:43

 回 4楼(kasim) 的帖子

内核已经能成功启动了,我把uImage后加上了.img,又做了一遍就能启动了。

U盘文件系统制作方法成功后是什么样的阿?怎么操作阿?我启动后显示如下信息。

U-Boot 2008.10 (Jan  7 2009 - 10:02:15)

DRAM:  64 MB
Flash:  1 MB
NAND:  NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3
V 8-bit)
64 MiB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x50000, size 0x250000
2424832 bytes read: OK
## Booting kernel from Legacy Image at 31000000 ...
   Image Name:   Linux-2.6.29.4-FriendlyARM
   Created:      2009-09-11   8:57:02 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2039912 Bytes =  1.9 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.............................................................
....................................................................... done, bo
oting the kernel.
Linux version 2.6.29.4-FriendlyARM (root@localhost.localdomain) (gcc version 4.3
.2 (Sourcery G++ Lite 2008q3-72) ) #33 Fri Sep 11 17:56:48 JST 2009
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: FriendlyARM Mini2440 development board
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttySAC0,115200 noinitrd root=/dev/uba1 rootwait=4 r
w ip=dhcp init=/linuxrc
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 60548KB available (3728K code, 405K data, 180K init)
SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 201.93 BogoMIPS (lpj=504832)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 296 bytes
NET: Registered protocol family 16
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4808000, irq 33
DMA channel 1 at c4808040, irq 34
DMA channel 2 at c4808080, irq 35
DMA channel 3 at c48080c0, irq 36
S3C244X: Clock Support, DVS off
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
yaffs Sep 11 2009 10:49:51 Installing.
msgmni has been set to 118
alg: No test for stdrng (krng)
io scheduler noop registered (default)
Console: switching to colour frame buffer device 30x20
fb0: s3c2410fb frame buffer device
backlight       initialized
syuturyokus     initialized
nyuryokus       initialized
leds    initialized
buttons initialized
pwm     initialized
adc     initialized
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
loop: module loaded
usbcore: registered new interface driver ub
dm9000 Ethernet Driver, V1.31
Now use the default MAC address: 08:90:90:90:90:90
eth0 (dm9000): not using net_device_ops yet
eth0: dm9000e at c4810000,c4814004 IRQ 51 MAC: 08:90:90:90:90:90 (friendly-arm)
Linux video capture interface: v2.00
gspca: main v2.4.0 registered
usbcore: registered new interface driver conex
conex: registered
usbcore: registered new interface driver etoms
etoms: registered
usbcore: registered new interface driver finepix
finepix: registered
usbcore: registered new interface driver mars
mars: registered
usbcore: registered new interface driver ov519
ov519: registered
usbcore: registered new interface driver ov534
ov534: registered
usbcore: registered new interface driver pac207
pac207: registered
usbcore: registered new interface driver pac7311
pac7311: registered
usbcore: registered new interface driver sonixb
sonixb: registered
usbcore: registered new interface driver sonixj
sonixj: registered
usbcore: registered new interface driver spca500
spca500: registered
usbcore: registered new interface driver spca501
spca501: registered
usbcore: registered new interface driver spca505
spca505: registered
usbcore: registered new interface driver spca506
spca506: registered
usbcore: registered new interface driver spca508
spca508: registered
usbcore: registered new interface driver spca561
spca561: registered
usbcore: registered new interface driver sunplus
sunplus: registered
usbcore: registered new interface driver stk014
stk014: registered
usbcore: registered new interface driver t613
t613: registered
usbcore: registered new interface driver tv8532
tv8532: registered
usbcore: registered new interface driver vc032x
vc032x: registered
usbcore: registered new interface driver zc3xx
zc3xx: registered
usbcore: registered new interface driver ALi m5602
ALi m5602: registered
usbcore: registered new interface driver STV06xx
STV06xx: registered
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v0.1.0)
initializing s3c2440 camera interface......
s3c2440 camif init done
Loading OV9650 driver.........
SCCB address 0x60, manufacture ID 0xFFFF, expect 0x7FA2
SCCB address 0x60, manufacture ID 0xFFFF, expect 0x7FA2
No OV9650 found!!!
Driver 'sd' needs updating - please use bus_type methods
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit
)
Scanning device for bad blocks
Bad eraseblock 2429 at 0x0000025f4000
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x000000000000-0x000000030000 : "supervivi"
0x000000050000-0x000000250000 : "Kernel"
0x000000250000-0x000003ffc000 : "root"
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: S3C24XX OHCI
usb usb1: Manufacturer: Linux 2.6.29.4-FriendlyARM ohci_hcd
usb usb1: SerialNumber: s3c24xx
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
usbserial: USB Serial Driver core
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
s3c2410 TouchScreen successfully loaded
input: s3c2410 TouchScreen as /devices/virtual/input/input0
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2410-rtc s3c2410-rtc: rtc disabled, re-enabling
s3c2410-rtc s3c2410-rtc: rtc core: registered s3c as rtc0
i2c /dev entries driver
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 98 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
mapped channel 0 to 0
s3c2440-sdi s3c2440-sdi: powered down.
s3c2440-sdi s3c2440-sdi: initialisation done.
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.18a.
No device for DAI UDA134X
No device for DAI s3c24xx-i2s
S3C24XX_UDA134X SoC Audio driver
UDA134X SoC Audio Codec
asoc: UDA134X <-> s3c24xx-i2s mapping ok
ALSA device list:
  #0: S3C24XX_UDA134X (UDA134X)
TCP cubic registered
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
s3c2410-rtc s3c2410-rtc: setting system clock to 2009-09-15 11:42:14 UTC (125301
4934)
usb 1-1: new full speed USB device using s3c2410-ohci and address 2
usb 1-1: New USB device found, idVendor=0a6b, idProduct=0004
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: USB Flash Memory
usb 1-1: Manufacturer:
usb 1-1: SerialNumber: 076C13150F2F
usb 1-1: configuration #1 chosen from 1 choice
uba: uba1
s3c2440-sdi s3c2440-sdi: running at 0kHz (requested: 0kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
s3c2440-sdi s3c2440-sdi: powered down.
eth0: link down
IP-Config: Guessing netmask 255.0.0.0
IP-Config: Complete:
     device=eth0, addr=62.0.0.0, mask=255.0.0.0, gw=255.255.255.255,
     host=62.0.0.0, domain=, nis-domain=(none),
     bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
kjournald starting.  Commit interval 5 seconds
EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
EXT3 FS on uba1, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) on device 180:1.
Freeing init memory: 180K
Warning: unable to open an initial console.
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
7楼  发表于: 2009-09-15 10:55
不要每次都在帖子里问不相关的问题,不要把你的帖子搞成一个大杂烩。
奉劝你一句,在进入一个新的问题之前,先想想是否真的把上一个问题解决了。不要到头来什么都搞了一点,什么都没明白
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 侠客
UID: 5629
精华: 0
发帖: 74
金钱: 755 两
威望: 496 点
贡献值: 0 点
综合积分: 148 分
注册时间: 2009-05-01
最后登录: 2012-03-16
8楼  发表于: 2009-09-15 12:01
好的