Beagle Black SD卡启动问题

虽然BBB是开源硬件,但坑也是比较多的,还好资料和用的人也比较多,暂时还都能找到问题所在。吐槽完了来看下SD启动的这个问题。

看了之前关于BBB启动方式的文章应该比较清楚,在eMMC已经写入系统的前提下(出厂已写入系统),要想从SD卡启动需要在启动时按着boot健(S2),Get Started网页和System Reference上面也都是这也说的。这种操作当然没错,但实际使用中发现即使不按S2,最终启动的也是SD卡中的内核,这就奇怪了,接上UART0,看看启动中发生了什么

U-Boot SPL 2017.09-00002-g0f3f1c7907 (Oct 09 2017 - 15:30:22)
Trying to boot from MMC1


U-Boot 2017.09-00002-g0f3f1c7907 (Oct 09 2017 - 15:30:22 -0500), Build: jenkins-github_Bootloader-Builder-607

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net:   eth0: MII MODE
cpsw
Press SPACE to abort autoboot in 2 seconds
board_name=[A335BNLT] ...
board_rev=[00C0] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** Bad device 0:2 0x82000000 **
** Bad device 0:2 0x82000000 **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
2045 bytes read in 35 ms (56.6 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.4.91-ti-r133 ...
8886912 bytes read in 588 ms (14.4 MiB/s)
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot.dtb] ...
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot.dtb ...
loading /boot/dtbs/4.4.91-ti-r133/am335x-boneblack-uboot.dtb ...
53192 bytes read in 130 ms (399.4 KiB/s)
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: loading /lib/firmware/AM335X-20-00A0.dtbo ...
378 bytes read in 271 ms (1000 Bytes/s)
uboot_overlays: loading /lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo ...
1105 bytes read in 114 ms (8.8 KiB/s)
uboot_overlays: loading /lib/firmware/BB-HDMI-TDA998x-00A0.dtbo ...
4169 bytes read in 277 ms (14.6 KiB/s)
uboot_overlays: loading /lib/firmware/BB-ADC-00A0.dtbo ...
695 bytes read in 428 ms (1000 Bytes/s)
uboot_overlays: loading /lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo ...
2402 bytes read in 479 ms (4.9 KiB/s)
uboot_overlays: loading /lib/firmware/univ-bbb-EVA-00A0.dtbo ...
54575 bytes read in 62 ms (859.4 KiB/s)
loading /boot/initrd.img-4.4.91-ti-r133 ...
5416133 bytes read in 369 ms (14 MiB/s)
debug: [console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet] ...
debug: [bootz 0x82000000 0x88080000:52a4c5 88000000] ...
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Ramdisk to 8fad5000, end 8ffff4c5 ... OK
   reserving fdt memory region: addr=88000000 size=75000
   Loading Device Tree to 8fa5d000, end 8fad4fff ... OK

Starting kernel ...

[    0.001537] clocksource_probe: no matching clocksources found
[    2.115874] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[    2.354197] omap_voltage_late_init: Voltage driver support not added
[    2.362673] PM: Cannot get wkup_m3_ipc handle

Debian GNU/Linux 9 beaglebone ttyS0

BeagleBoard.org Debian Image 2017-10-10

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

beaglebone login:

 

上面是按下S2键的情况下的启动信息,可以看到直接启动SD卡中的UBOOT(2017),然后启动SD卡中内核。下面看看不按S2键的启动信息

U-Boot SPL 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31)
Trying to boot from MMC
bad magic


U-Boot 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31 -0600), Build: jenkins-github_Bootloader-Builder-313

       Watchdog enabled
I2C:   ready
DRAM:  512 MiB
Reset Source: Power-on reset has occurred.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Net:   <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
2045 bytes read in 36 ms (54.7 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.4.91-ti-r133 ...
8886912 bytes read in 513 ms (16.5 MiB/s)
loading /boot/dtbs/4.4.91-ti-r133/am335x-boneblack.dtb ...
56891 bytes read in 149 ms (372.1 KiB/s)
loading /boot/initrd.img-4.4.91-ti-r133 ...
5416133 bytes read in 325 ms (15.9 MiB/s)
debug: [console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet] ...
debug: [bootz 0x82000000 0x88080000:52a4c5 0x88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0x879a80 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Ramdisk to 8fad5000, end 8ffff4c5 ... OK
   Loading Device Tree to 8fac4000, end 8fad4e3a ... OK

 

可以看到,先启动了eMMC中的UBOOT(2016),然后出现了mmc0 is current device,mmc0就是SD卡,也就是启动的是eMMC中的UBOOT,然后又跳转到SD卡启动了内核。Google了一下,在Github中(https://github.com/victronenergy/venus/wiki/bbb-boot-process-overview)对此问题有明确的解释

Note

By default, the BBB u-boot always looks for a kernel and DTS from the SD card (MMC0) before the eMMC (MMC1) regardless of the boot device that MLO and u-boot.img loaded from.

This is a new 'feature' in u-boot.

This feature does allows for testing new kernels and rootfs systems without having to install onto the eMMC.

On the downside, every eMMC boot is now slowed slightly as u-boot looks for a kernel and DTS on the SD card, fails when there is no card present or it can't find a zImage or dts, and then tries again from the eMMC.

Disabling this behavior requires a rebuild of u-boot.

大意就是说这是UBOOT的新特性,为了利用SD卡调试方便,不管是从eMMC还是SD卡中启动的UBOOT,都会优先启动SD卡中的内核。次文档发表时间是2015年11月11日,但具体是从哪个版本的UBOOT开始还没查到可靠资料。对于此问题也有其它国外论坛在讨论,并且有大神给出了如下启动图

感想:这种开源非盈利性的东西,虽然资料很多,但出现了这么大的改动也没人把更新到文档中。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值