[U-Boot] Theory of Operations

Kenny Koller kenny at understoryweather.com
Fri Jul 14 00:18:58 UTC 2017


I've looked around on denx.de and haven't found such a document. Of course
there is the manual which is helpful for understanding the commands.

The general problem I'm having is that my lack of understanding as to what
U-Boot is trying to do is making it difficult for me to debug things. I'm
also struggling with the console messages.

The specific problem is that I'm attempting to boot from an SD card on a
Beaglebone Black using the raw mode option of the TI Sitara OMAP4
processor. The basics are that you can install a binary (SPL) with a
special header in one of four locations using the raw sectors of the card
(no filesystem). The ROM code will find this and it will find U-Boot on
some sectors at 384 kB.

The SPL is found and it loads U-Boot:

U-Boot SPL 2017.01 (Jun 28 2017 - 23:47:37)
Trying to boot from MMC1MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment

U-Boot 2017.01 (Jun 28 2017 - 23:47:37 +0000)

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
** First descriptor is NOT a primary desc on 1:1 **
*** Warning - bad CRC, using default environment

<ethaddr> not set. Validating first E-fuse MAC
Net:   cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
=>

But I'm not sure what this is trying to do next:

switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** File not found boot.scr **
** Unrecognized filesystem type **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** Invalid partition 2 **
** First descriptor is NOT a primary desc on 1:1 **
switch to partitions #0, OK
mmc1(part 0) is current device
** No partition table - mmc 1 **
** First descriptor is NOT a primary desc on 1:1 **
switch to partitions #0, OK
mmc1(part 0) is current device
** First descriptor is NOT a primary desc on 1:1 **
SD/MMC found on device 1
** No partition table - mmc 1 **
## Error: "bootcmd_nand0" not defined

The next logical step it seems would be to load the U-Boot environment. I
find these log messages difficult to understand. For example "switch to
partitions #0" and "First descriptor is NOT a primary desc" make little
sense to me. But it appears to be trying find a partition and examine a
filesystem.

In my last iteration of the SD card I was using a method whereby the PSL,
the kernel, the DTB, uEnv.txt, and uboot.img all lived on the first
partition which was FAT and bootable. Now I have accounted for the PSL and
U-Boot but it's not clear to me where it picks up the rest. I suspect that
it will look on EXT4 formatted partition under /boot but it's not clear why
it can't interpret the partition (I can mount that partition under Ubuntu
by the way).

In general though if I understood what the logic was attempting to do and
some clearer log messages I feel that I could debug this in a methodical
way.

Thanks.


More information about the U-Boot mailing list