Linux 嵌入式开发板 - Kernel Panic 问题

逆向工程 固件 linux 嵌入式
2021-06-15 20:04:43

我需要复制一个基于 Yocto-based Linux 的旧嵌入式板。

我买了一块相同部件号的新板,现在我需要把旧软件放在新板上(新板只安装了 u-boot)。

原来的板子有u-boot,命令列表很少,所以我不得不通过串行终端转储内存。

我在 .txt 中获取了一些带有内部存储器数据的文件,然后使用 Linuxxxd -r命令将它们转换为 .bin并将数据放入我的新板中。

当我打开我的新主板时,Linux 内核启动但找不到分区并停止工作并说:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

旧板引导:

U-Boot 2009.01 (May 28 2011 - 03:25:24)

CPU:   Freescale i.MX25 at 398 MHz
Board: GEA_M6425 
I2C:   ready
DRAM:  64 MB
NAND:  Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
256 MiB
NAND read: device 0 offset 0xc0000, size 0x40000
    262144 bytes read: OK
In:    serial
Out:   serial
Err:   serial
i2c_addr:chip address cycle fail(a1)
Net:   miiphy_register: non unique device name 'FEC0'
FEC0, FEC0
Version: 
Note:    
Auto-update from TFTP: trying update file 'prog.scr'
FEC: enable RMII gasket
Using FEC0 device
TFTP from server 192.168.140.12; our IP address is 192.168.140.30
Filename 'prog.scr'.
Load address: 0x81000000
Loading: *T T T T T T T T T T T T T T T T T T T T 
Retry count exceeded; starting again
Can't load update file, aborting auto-update
Auto-update from NAND:
NAND read: device 0 offset 0x1000000, size 0x20
    32 bytes read: OK
No image found.
Hit any key to stop autoboot:  3  2  1  0 
NAND read: device 0 offset 0x100000, size 0x300000
    3145728 bytes read: OK
## Booting kernel from Legacy Image at 81000000 ...
    Image Name:   Linux-2.6.31-rc9
    Image Type:   ARM Linux Kernel Image (uncompressed)
    Data Size:    2318824 Bytes =  2.2 MB
    Load Address: 80008000
    Entry Point:  80008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux....................................................................................................................................................... done, booting the kernel.
Linux version 2.6.31-rc9 (user@evelin) (gcc version 4.1.2) #1 PREEMPT Tue Sep 27 21:35:47 CEST 2011
CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Freescale MX25 3-Stack Board
Ignoring unrecognised tag 0x54410008
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttymxc0,115200 root=/dev/mtdblock2 rootfstype=jffs2 video=mxcfb:320x240,16bpp,Var-QVGA
PID hash table entries: 256 (order: 8, 1024 bytes)
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: 59916KB available (4264K code, 484K data, 124K init, 0K highmem)
NR_IRQS:272
MXC IRQ initialized
Clock input source is 24000000
Console: colour dummy device 80x30
Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
regulator: core version 0.5
NET: Registered protocol family 16
AIPS1 VA base: 0xfc000000
CPU is i.MX25 Revision 1.0
MXC GPIO hardware
rate 22166666
Using SDMA I.API
MXC DMA API initialized
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
MXC I2C driver
i2c-adapter i2c-0: ACK not received 
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
Bus freq driver module loaded
usb: Host 2 host (serial) registered
usb: DR host (utmi) registered
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
SGI XFS with security attributes, large block/inode numbers, no debug enabled
msgmni has been set to 117
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
MXC Backlight Device mxc_lcdc_bl.0 Initialized.
Console: switching to colour frame buffer device 40x30
mxc_sdc_fb mxc_sdc_fb.0: fb0: DISP0 BG fb device registered successfully.
mxc_sdc_fb mxc_sdc_fb.0: fb1: DISP0 FG fb device registered successfully.
Serial: MXC Internal UART driver
mxcintuart.0: ttymxc0 at MMIO 0x43f90000 (irq = 45) is a Freescale i.MX
console [ttymxc0] enabled
mxcintuart.1: ttymxc1 at MMIO 0x43f94000 (irq = 32) is a Freescale i.MX
mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 18) is a Freescale i.MX
brd: module loaded
loop: module loaded
Freescale FlexCAN Driver 
FEC Ethernet Driver
fec_enet_mii_bus: probed
IEEE1588: ptp-timer is unavailable
console [netcon0] enabled
netconsole: network logging started
MXC MTD nand Driver 2.5
NAND device: Manufacturer ID: 0x20, Chip ID: 0xaa (ST Micro NAND 256MiB 1,8V 8-bit)
Searching for RedBoot partition table in NAND 256MiB 1,8V 8-bit at offset 0xff60000
No RedBoot partition table detected in NAND 256MiB 1,8V 8-bit
Creating 5 MTD partitions on "NAND 256MiB 1,8V 8-bit":
0x000000000000-0x000000100000 : "nand.bootloader"
0x000000100000-0x000000400000 : "nand.kernel"
0x000000400000-0x00000fc00000 : "nand.rootfs"
0x00000fc00000-0x00000fd00000 : "nand.configure"
0x00000fd00000-0x000010000000 : "nand.userfs"
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
fsl-ehci fsl-ehci.0: irq 35, io base 0x53ff4400
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 2
fsl-ehci fsl-ehci.1: irq 37, io base 0x53ff4000
fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
i.MX ADC at 0x50030000 irq 46
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
mxsdhci: MXC Secure Digital Host Controller Interface driver
mxsdhci: MXC SDHCI Controller Driver. 
mmc0: SDHCI detect irq 161 irq 9 INTERNAL DMA
Advanced Linux Sound Architecture Driver Version 1.0.20.
regulator: Unable to get requested regulator: VDDIO
regulator: Unable to get requested regulator: VDDA
regulator: Unable to get requested regulator: VDDD
sgtl5000-i2c 0-000a: SGTL5000 revision 17
No device for DAI imx-ssi-1-0
No device for DAI imx-ssi-1-1
No device for DAI imx-ssi-2-0
No device for DAI imx-ssi-2-1
DMA Sound Buffers Allocated:UseIram=0 buf->addr=83ab0000 buf->area=fde56000 size=65536
DMA Sound Buffers Allocated:UseIram=0 buf->addr=83ac0000 buf->area=fde66000 size=65536
asoc: SGTL5000 <-> imx-ssi-1-0 mapping ok
ALSA device list:
    #0: imx-3stack (SGTL5000)
oprofile: using timer interrupt.
TCP cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20090105 abi 8)
NET: Registered protocol family 29
can: raw protocol (rev 20090105)
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
Static Power Management for Freescale i.MX25
on-off key pressed
input: imx_adc_ts as /class/input/input0
i.MX ADC input touchscreen loaded.
JFFS2 doesn't use OOB.
VFS: Mounted root (jffs2 filesystem) on device 31:2.
Freeing init memory: 124K

init started: BusyBox v1.15.3 (2011-09-27 21:22:33 CEST)
starting pid 898, tty '': '/etc/init.d/rcS'
Initializing mdev dynamic device directory ... done
eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1)

can0 bitrate: 175000
dropbear already configured
Starting Dropbear SSH server: dropbear.
ts already configured

starting pid 939, tty '/dev/ttymxc0': '-/bin/sh'

BusyBox v1.15.3 (2011-09-27 21:22:33 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/ # 

新板引导:

U-Boot 2009.01-dirty (Nov 15 2013 - 17:55:59)
CPU:   Freescale i.MX25 at 398 MHz
Board: GEA_M6425 
I2C:   ready
DRAM:  64 MB
NAND:  Bad block table not found for chip 0
Bad block table not found for chip 0
Bad block table written to 0x0ffe0000, version 0x01
Bad block table written to 0x0ffc0000, version 0x01
256 MiB
Use default panel_info values
In:    serial
Out:   serial
Err:   serial
i2c_addr:chip address cycle fail(a1)
Net:   FEC0
Version: 
Note:    
Hit any key to stop autoboot:  3  2  1  0 
NAND read: device 0 offset 0x100000, size 0x300000
    3145728 bytes read: OK
## Booting kernel from Legacy Image at 81000000 ...
    Image Name:   Linux-2.6.31-rc9
    Image Type:   ARM Linux Kernel Image (uncompressed)
    Data Size:    2318824 Bytes =  2.2 MB
    Load Address: 80008000
    Entry Point:  80008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux....................................................................................................................................................... done, booting the kernel.
Linux version 2.6.31-rc9 (user@evelin) (gcc version 4.1.2) #1 PREEMPT Tue Sep 27 21:35:47 CEST 2011
CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Freescale MX25 3-Stack Board
Ignoring unrecognised tag 0x54410008
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttymxc0,115200 root=/dev/mtdblock2 rootfstype=jffs2 video=mxcfb:800x480,16bpp,Amp-WD
PID hash table entries: 256 (order: 8, 1024 bytes)
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: 59916KB available (4264K code, 484K data, 124K init, 0K highmem)
NR_IRQS:272
MXC IRQ initialized
Clock input source is 24000000
Console: colour dummy device 80x30
Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
regulator: core version 0.5
NET: Registered protocol family 16
AIPS1 VA base: 0xfc000000
CPU is i.MX25 Revision 1.0
MXC GPIO hardware
rate 22166666
Using SDMA I.API
MXC DMA API initialized
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
MXC I2C driver
i2c-adapter i2c-0: ACK not received 
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
Bus freq driver module loaded
usb: Host 2 host (serial) registered
usb: DR host (utmi) registered
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
SGI XFS with security attributes, large block/inode numbers, no debug enabled
msgmni has been set to 117
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
MXC Backlight Device mxc_lcdc_bl.0 Initialized.
Console: switching to colour frame buffer device 100x30
mxc_sdc_fb mxc_sdc_fb.0: fb0: DISP0 BG fb device registered successfully.
mxc_sdc_fb mxc_sdc_fb.0: fb1: DISP0 FG fb device registered successfully.
Serial: MXC Internal UART driver
mxcintuart.0: ttymxc0 at MMIO 0x43f90000 (irq = 45) is a Freescale i.MX
console [ttymxc0] enabled
mxcintuart.1: ttymxc1 at MMIO 0x43f94000 (irq = 32) is a Freescale i.MX
mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 18) is a Freescale i.MX
brd: module loaded
loop: module loaded
Freescale FlexCAN Driver 
FEC Ethernet Driver
fec_enet_mii_bus: probed
IEEE1588: ptp-timer is unavailable
console [netcon0] enabled
netconsole: network logging started
MXC MTD nand Driver 2.5
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xaa (Micron NAND 256MiB 1,8V 8-bit)
Unrecognized NAND Flash device.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
fsl-ehci fsl-ehci.0: irq 35, io base 0x53ff4400
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 2
fsl-ehci fsl-ehci.1: irq 37, io base 0x53ff4000
fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
i.MX ADC at 0x50030000 irq 46
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
mxsdhci: MXC Secure Digital Host Controller Interface driver
mxsdhci: MXC SDHCI Controller Driver. 
mmc0: SDHCI detect irq 161 irq 9 INTERNAL DMA
Advanced Linux Sound Architecture Driver Version 1.0.20.
regulator: Unable to get requested regulator: VDDIO
regulator: Unable to get requested regulator: VDDA
regulator: Unable to get requested regulator: VDDD
sgtl5000-i2c 0-000a: SGTL5000 revision 17
No device for DAI imx-ssi-1-0
No device for DAI imx-ssi-1-1
No device for DAI imx-ssi-2-0
No device for DAI imx-ssi-2-1
DMA Sound Buffers Allocated:UseIram=0 buf->addr=83a90000 buf->area=fdf82000 size=65536
DMA Sound Buffers Allocated:UseIram=0 buf->addr=83aa0000 buf->area=fdf92000 size=65536
asoc: SGTL5000 <-> imx-ssi-1-0 mapping ok
ALSA device list:
    #0: imx-3stack (SGTL5000)
oprofile: using timer interrupt.
TCP cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20090105 abi 8)
NET: Registered protocol family 29
can: raw protocol (rev 20090105)
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
Static Power Management for Freescale i.MX25
on-off key pressed
input: imx_adc_ts as /class/input/input0
i.MX ADC input touchscreen loaded.
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
List of all partitions:
No filesystem could mount root, tried:  jffs2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

你能帮我理解这个问题吗?


这些是文件命令的输出:

nand_bootloader_0x0000000-0x00FFFFF.bin: FoxPro FPT, blocks size 0, next free block index 1778450666

nand_kernel_0x0100000-0x03FFFFF.bin: u-boot legacy uImage, Linux-2.6.31-rc9, Linux/ARM, OS Kernel Image (Not compressed), 2318824 bytes, Tue Sep 27 21:36:01 2011, Load Address: 0x80008000, Entry Point: 0x80008000, Header CRC: 0x230C882F, Data CRC: 0xCD73A8A7

nand_rootfs_1_0x0400000-0x06FFFFF.bin: AIX core file fulldump 32-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377 64-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377


nand_rootfs_2_0x0700000-0x09FFFFF.bin: Linux jffs2 filesystem data little endian

nand_rootfs_3_0x0A00000-0x0EFFFFF.bin: AIX core file fulldump 32-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377 64-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377

nand_rootfs_4_0x0F00000-0x13FFFFF.bin: AIX core file fulldump 32-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377 64-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377

nand_rootfs_5_0x1400000-0x18FFFFF.bin: AIX core file fulldump 32-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377 64-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377

nand_rootfs_6_0x1900000-0x1DFFFFF.bin: AIX core file fulldump 32-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377 64-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377


nand_rootfs_7_0x1E00000-0x22FFFFF.bin: Linux jffs2 filesystem data little endia

nand_configure_0xFC00000-0xFCFFFFF.bin: u-boot legacy uImage, Linux-2.6.31-rc9-gec38174-dirty, Linux/ARM, OS Kernel Image (Not compressed), 2321092 bytes, Fri Oct  8 23:26:48 2010, Load Address: 0x80008000, Entry Point: 0x80008000, Header CRC: 0xE1994975, Data CRC: 0x55F17506

nand_userfs_0xFD00000-0xFFFFFFF.bin: data

(rootfs 被分成 7 个文件)。

更新:

嗨,我用你的命令制作了一个连续的文件。现在我在我的 linux PC 上设置 NFS 服务器(在/etc/exports我把字符串放在文件中/srv myip/my mask(rw,sync,no_subtree_check,no_root_squash)并保存。我将nand_rootfs.bin文件放在文件夹中/srv,然后尝试在我的板上设置 UBOOT。这是printenv我的 Uboot命令:

bootdelay=3
baudrate=115200
loadaddr=0x81000000
netdev=eth0
ethprime=fec
bootargs_nand=console=ttymxc0,115200 root=/dev/mtdblock2 rootfstype=jffs2 video=
mxcfb:320x240,16bpp,Var-QVGA
bootcmd_nand=nand read 81000000 100000 300000; bootm 81000000
bootcmd_tftp=tftp uImage; bootm
mirror_update=enable
tftp_timeout=6000
tftp_retry=20
checksum_control=false
ethact=FEC0
filesize=27B84
fileaddr=80800000
offset=80000
GEA_SN=A54673
fec_addr=9C:53:CD:05:5E:C2
fecaddr=9C:53:CD:05:5E:C2
ethaddr=9C:53:CD:05:5E:C2
splashload=nand read 80800000 c0000 40000
splashimage=80800000
lcd_name=Var-QVGA
splashpos=0,0
bootcmd=run bootcmd_nand
bootargs=console=ttymxc0,115200 root=/dev/mtdblock2 rw rootfstype=jff2 video=mxcfb:320x240,16bpp,Var-QVGA mtdparts=nand:1M(nand.bootloader),3M(nand.kernel),-(rootfs)
ipaddr=192.168.11.60
serverip=192.168.11.64
bootargs_nfs=console=ttymxc0,115200 root=/dev/nfs rw ip=$(ipaddr) nfsroot=$(serverip):/srv/nand_rootfs.bin rootfstype=jff2 video=mxcfb:320x240,16bpp,Var-QVGA

Environment size: 991/262140 bytes

当我运行命令时:

run bootargs_nfs

我得到:

Unknown command 'console=ttymxc0,115200' - try 'help'

这个程序正确吗?我修改了bootargs_nfswith 命令:

setenv 'bootargs_nfs console=ttymxc0,115200 root=/dev/nfs rw ip=$(ipaddr) nfsroot=$(serverip):/srv/nand_rootfs.bin rootfstype=jff2 video=mxcfb:320x240,16bpp,Var-QVGA'
1个回答

好吧,我(还)不是专家,但由于我现在从事嵌入式软件工作,我猜这是您的问题:

老的:

MXC MTD nand Driver 2.5
NAND device: Manufacturer ID: 0x20, Chip ID: 0xaa (ST Micro NAND 256MiB 1,8V 8-bit)
Searching for RedBoot partition table in NAND 256MiB 1,8V 8-bit at offset 0xff60000
No RedBoot partition table detected in NAND 256MiB 1,8V 8-bit
Creating 5 MTD partitions on "NAND 256MiB 1,8V 8-bit":
0x000000000000-0x000000100000 : "nand.bootloader"
0x000000100000-0x000000400000 : "nand.kernel"
0x000000400000-0x00000fc00000 : "nand.rootfs"
0x00000fc00000-0x00000fd00000 : "nand.configure"
0x00000fd00000-0x000010000000 : "nand.userfs"

新的:

MXC MTD nand Driver 2.5
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xaa (Micron NAND 256MiB 1,8V 8-bit)
Unrecognized NAND Flash device.

长话短说,你需要一些你的内核能够识别的东西。NAND 组件来自不同的供应商,因此虽然制造商的主板可能相同,但它们在对旧内核很重要的细节上有所不同。

此外,您的内核命令行(通常来自 U-Boot 环境)在两次引导之间有所不同。


但是,我认为至少有一种方法可以启动它,如下所示:

  • 从 U-Boot 环境中(基本上你在Hit any key to stop autoboot:提示期间按下了一个键)你会发现你的新板如何找到 NFS 服务器
  • 设置本地 DHCP 服务器
  • 确保在预期路径下使旧板的根 FS 可用
  • 启动 - 就像您现在所做的一样 - 您应该在 NFS 根 FS 上启动并运行系统

虽然这并不能解决修改现有内核以完全从新板上的 NAND 启动的问题,但它可以让您进一步修改内核恐慌当前阻止您执行的新启动

这也有可能是U-Boot的环境改变的东西将进一步得到你,但是是我想在这一点上做的。