Linux kernel VFS:无法打开根设备“;mmcblk0p2“;或未知块(179,2):错误-2

Linux kernel VFS:无法打开根设备“;mmcblk0p2“;或未知块(179,2):错误-2,linux-kernel,embedded-linux,boot,sd-card,mmc,Linux Kernel,Embedded Linux,Boot,Sd Card,Mmc,我想做的是在STM32F769I发现板上运行一个带rootfs的Linux内核 我使用Buildroot为它构建了u-boot、内核和设备树,这对我来说是一个艰难的过程,因为我是嵌入式系统的初学者 我已经设法让它达到了内核必须从SD卡挂载rootfs分区的地步,但它无法做到这一点。这里的引导分区设置正确,甚至被内核识别,但不知何故内核仍然恐慌,无法读取它 SD卡上有两个分区: mmcblk0p1: vfat mmcblk0p2: ext3 内核启动日志: Starting kernel ...

我想做的是在STM32F769I发现板上运行一个带rootfs的Linux内核

我使用Buildroot为它构建了u-boot、内核和设备树,这对我来说是一个艰难的过程,因为我是嵌入式系统的初学者

我已经设法让它达到了内核必须从SD卡挂载rootfs分区的地步,但它无法做到这一点。这里的引导分区设置正确,甚至被内核识别,但不知何故内核仍然恐慌,无法读取它

SD卡上有两个分区:

mmcblk0p1: vfat
mmcblk0p2: ext3
内核启动日志:

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 5.4.61 (zjerina@debian) (gcc version 8.4.0 (Buildroot 2020.02.5)) #1 PREEMPT Thu Sep 10 17:22:19 EDT 2020
CPU: ARMv7-M [411fc270] revision 0 (ARMv7M), cr=00000000
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
OF: fdt: Machine model: STMicroelectronics STM32F769-DISCO board
On node 0 totalpages: 4096
  Normal zone: 32 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 4096 pages, LIFO batch:0
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0 
Built 1 zonelists, mobility grouping off.  Total pages: 4064
Kernel command line: console=ttySTM0,115200n8 noinitrd root=/dev/mmcblk0p2 rootfstype=ext3 rw rootwait rootdelay=60 loglevel=60
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 12784K/16384K available (2278K kernel code, 170K rwdata, 544K rodata, 104K init, 117K bss, 3600K reserved, 0K cma-reserved)
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
rcu: Preemptible hierarchical RCU implementation.
        Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
/soc/interrupt-controller@40013c00: bank0
random: get_random_bytes called from 0xc02ee535 with crng_init=0
clocksource: arm_system_timer: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 298634427 ns
ARM System timer initialized as clocksource
sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 21474836475ns
timer@40000c00: STM32 sched_clock registered
Switching to timer-based delay loop, resolution 10ns
timer@40000c00: STM32 delay timer registered
clocksource: timer@40000c00: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns
/soc/timer@40000c00: STM32 clockevent driver initialized (32 bits)
Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=1000000)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
rcu: Hierarchical SRCU implementation.
devtmpfs: initialized
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
stm32f769-pinctrl soc:pin-controller: No package detected, use default one
stm32f769-pinctrl soc:pin-controller: GPIOA bank added
stm32f769-pinctrl soc:pin-controller: GPIOB bank added
stm32f769-pinctrl soc:pin-controller: GPIOC bank added
stm32f769-pinctrl soc:pin-controller: GPIOD bank added
stm32f769-pinctrl soc:pin-controller: GPIOE bank added
stm32f769-pinctrl soc:pin-controller: GPIOF bank added
stm32f769-pinctrl soc:pin-controller: GPIOG bank added
stm32f769-pinctrl soc:pin-controller: GPIOH bank added
stm32f769-pinctrl soc:pin-controller: GPIOI bank added
stm32f769-pinctrl soc:pin-controller: GPIOJ bank added
stm32f769-pinctrl soc:pin-controller: GPIOK bank added
stm32f769-pinctrl soc:pin-controller: Pinctrl STM32 initialized
clocksource: Switched to clocksource timer@40000c00
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
NET: Registered protocol family 1
workingset: timestamp_bits=30 max_order=12 bucket_order=0
fuse: init (API version 7.31)
io scheduler mq-deadline registered
io scheduler kyber registered
STM32 USART driver initialized
40011000.serial: ttySTM0 at MMIO 0x40011000 (irq = 35, base_baud = 6250000) is a stm32-usart
printk: console [ttySTM0] enabled
stm32-usart 40011000.serial: rx dma alloc failed
stm32-usart 40011000.serial: interrupt mode used for rx (no dma)
stm32-usart 40011000.serial: tx dma alloc failed
stm32-usart 40011000.serial: interrupt mode used for tx (no dma)
libphy: Fixed MDIO Bus: probed
stm32_rtc 40002800.rtc: registered as rtc0
stm32_rtc 40002800.rtc: Date/Time must be initialized
i2c /dev entries driver
stm32f7-i2c 40005400.i2c: can't use DMA
stm32f7-i2c 40005400.i2c: STM32F7 I2C-0 bus adapter
mmci-pl18x 40011c00.sdio2: Got CD GPIO
mmci-pl18x 40011c00.sdio2: mmc0: PL180 manf 80 rev8 at 0x40011c00 irq 36,0 (pio)
mmci-pl18x 40011c00.sdio2: DMA channels RX none, TX none
mmc0: host does not support reading read-only switch, assuming write-enable
mmc0: new SDHC card at address aaaa
input: gpio_keys as /devices/platform/gpio_keys/input/input0
mmcblk0: mmc0:aaaa SL08G 7.40 GiB 
stm32_rtc 40002800.rtc: setting system clock to 2000-01-01T00:38:58 UTC (946687138)
 mmcblk0: p1 p2
Warning: unable to open an initial console.
Waiting 60 sec before mounting root device...
random: fast init done
Failed to create /dev/root: -2
VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -2
Please append a correct "root=" boot option; here are the available partitions:
b300         7761920 mmcblk0 
 driver: mmcblk
  b301           51200 mmcblk0p1 d7154cc1-01

  b302         7709696 mmcblk0p2 d7154cc1-02

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2) ]---

我不知道在什么情况下它会吐出一个enoint(-2)。我唯一的想法是检查内核中是否有ext3文件系统驱动程序。恐慌中没有stacktrace吗?是的,内核中有ext3支持。这就是我得到的所有输出,可能需要设置其他引导参数,或者我必须使用调试符号进行编译?您可以共享您的内核配置吗?这里可能有一些有趣的东西。我的内核配置在这里,希望我做错了什么: