Can't boot from sd-card on BeagleBone Black

Discussion about U-Boot and the kernel.

Can't boot from sd-card on BeagleBone Black

Postby Pavel47 » Sat Aug 29, 2020 2:18 pm

Hello,

I've tried two different default configurations while building u-boot:
    am335x_boneblack_vboot_defconfig
    am335x_evm_defconfig
I formatted sd-card with this script:
https://github.com/PacktPublishing/Mastering-Embedded-Linux-Programming-Second-Edition/blob/master/format-sdcard.sh
Then I copied MLO and u-boot.img into the boot partition.
Here is boot log for am335x_boneblack_vboot_defconfig case (for am335x_evm_defconfig it's similar):

U-Boot SPL 2020.10-rc3 (Aug 28 2020 - 10:16:38 +0200)
$this->bbcode_second_pass_code('', 'WDT: Not found! 
Trying to boot from MMC1 
Loading Environment from FAT... *** Warning - bad CRC, using default environment 
Loading Environment from MMC... *** Warning - bad CRC, using default environment
U-Boot 2020.10-rc3 (Aug 28 2020 - 10:16:38 +0200)
CPU : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black 
DRAM: 512 MiB 
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 
Loading Environment from FAT... *** Warning - bad CRC, using default environment 
Loading Environment from MMC... *** Warning - bad CRC, using default environment
<ethaddr> not set. Validating first E-fuse MAC
Net: eth2: ethernet@4a100000, eth3: usb_ether 
Press SPACE to abort autoboot in 2 seconds 
switch to partitions #0, OK 
mmc0 is current device 
SD/MMC found on device 0 
Failed to load 'boot.scr' 
Failed to load 'uEnv.txt' 
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 
Failed to load '/boot/zImage' 
switch to partitions #0, OK 
mmc1(part 0) is current device 
Scanning mmc 1:1... 
Found /boot/extlinux/extlinux.conf')

As you see, it tries to boot from MMC1 (I suppose that it's sd-card), fails, then switches to mmc0, which is certainly eMMC.
And in both cases - warnings "bad CRC".
Could it be problem of copying of u-boot files ... or erroneous formatting of sd-card.
Have you any idea how to check these issues.
Thanks.
Sincerely,
Pavel.
Last edited by moonman on Sat Aug 29, 2020 4:52 pm, edited 1 time in total.
Reason: code tags
Pavel47
 
Posts: 8
Joined: Sat Aug 29, 2020 2:06 pm

Re: Can't boot from sd-card on BeagleBone Black

Postby moonman » Sat Aug 29, 2020 5:00 pm

It doesn't look like you have any custom environment set up, as it can't find any.

The main problem here though is that it can't find your kernel in /boot/zImage.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: Can't boot from sd-card on BeagleBone Black

Postby Pavel47 » Sat Aug 29, 2020 6:24 pm

Here is extract form the book "Mastering Embedded Linux Programming", Chris Simmonds

Image
Image

As you can see the author succeeded to boot using only u-boot part.
Unfortunately I couldn't repeat all steps exactly as he did: I couldn't build v2017 branch of u-boot and used master branch.
Pavel47
 
Posts: 8
Joined: Sat Aug 29, 2020 2:06 pm

Re: Can't boot from sd-card on BeagleBone Black

Postby moonman » Sun Aug 30, 2020 3:56 am

1. Are you booting up ArchLinux ARM?
2. What's the output of "ls -lh <your-sd-card>/boot"
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: Can't boot from sd-card on BeagleBone Black

Postby Pavel47 » Sun Aug 30, 2020 10:57 am

Are you booting up ArchLinux ARM?
No, there is no any Linux, only u-boot.

What's the output of "ls -lh <your-sd-card>/boot"
$this->bbcode_second_pass_code('', 'pavel@ALABAMA:~$ ls -lh /media/pavel/boot/
total 874K
-rw-r--r-- 1 pavel pavel 107K août 29 11:45 MLO
-rw-r--r-- 1 pavel pavel 765K août 29 11:45 u-boot.img
pavel@ALABAMA:~$')
Pavel47
 
Posts: 8
Joined: Sat Aug 29, 2020 2:06 pm

Re: Can't boot from sd-card on BeagleBone Black

Postby summers » Sun Aug 30, 2020 3:46 pm

Oh yes- for what its worth, reading I done says that am335x_evm_defconfig is meant to be the main configuration for beagle boards in recent uboot:
http://u-boot.10912.n7.nabble.com/PATCH-configs-Remove-am335x-boneblack-defconfig-td355136.html
Basically all the uboot were the same, and it reads the board type from the rom, and sets the device tree.

Make sure you have distro enabled, as thats the default for arch uboot, means its looks for a boot.scr file on / and /boot. e.g on my BBB the file /boot/boot.txt is:
$this->bbcode_second_pass_code('', '# After modifying, run ./mkscr

if test -n ${distro_bootpart}; then setenv bootpart ${distro_bootpart}; else setenv bootpart 1; fi
part uuid ${devtype} ${devnum}:${bootpart} uuid

setenv bootargs "console=tty0 console=${console} root=PARTUUID=${uuid} rw rootwait"

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
gpio set 54
echo fdt: ${fdtfile}
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
gpio set 55
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
gpio set 56
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
else
gpio set 56
bootz ${kernel_addr_r} - ${fdt_addr_r};
fi;
fi;
fi
')

and mkscr does:
$this->bbcode_second_pass_code('', 'mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d boot.txt boot.scr')
AH - you are using $this->bbcode_second_pass_code('', 'extlinux.conf') rather than $this->bbcode_second_pass_code('', 'boot.scr') - so thats not what arch does. Suggest you read the distro readme on the denx uboot site https://gitlab.denx.de/u-boot/u-boot/-/blob/master/doc/README.distro
And out of interest, how can you boot an OS, when you have no OS installed? Suggest you just interupt uboot on the way up, and type whatever commands you want there - but only try and boot when you have an OS installed ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Can't boot from sd-card on BeagleBone Black

Postby Pavel47 » Sun Aug 30, 2020 5:43 pm

$this->bbcode_second_pass_quote('', 'O')h yes- for what its worth, reading I done says that am335x_evm_defconfig is meant to be the main configuration for beagle boards in recent uboot


I also tried with am335x_evm_defconfig. Here is log (top part):
$this->bbcode_second_pass_code('', 'U-Boot SPL 2020.10-rc3-00012-g9f04a634ef (Aug 29 2020 - 11:40:17 +0200)
Trying to boot from MMC1
U-Boot 2020.10-rc3-00012-g9f04a634ef (Aug 29 2020 - 11:40:17 +0200)
CPU : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM: 512 MiB
WDT: Started with servicing (60s timeout)
NAND: 0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment
<ethaddr> not set. Validating first E-fuse MAC
Net: eth2: ethernet@4a100000, eth3: usb_ether
Hit any key to stop autoboot: 0
 switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
Failed to load 'boot.scr'
Failed to load 'uEnv.txt'
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
Failed to load '/boot/zImage'
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Found /boot/extlinux/extlinux.conf')

$this->bbcode_second_pass_quote('', 'M')ake sure you have distro enabled, as thats the default for arch uboot, means its looks for a boot.scr file on / and /boot. e.g on my BBB the file /boot/boot.txt is

Frankly, here I have trouble following you. As I explained before, on the sd-card I have only two files, both in the boot partition:
    MLO
    u-boot.img
... and nothing else.

$this->bbcode_second_pass_quote('', 'A')nd out of interest, how can you boot an OS, when you have no OS installed?

In my current exercises I have no plan to boot OS, just pass two stages of the bootloader (MLO and u-boot.img) and stop.
In order to have the following prompt in the serial debugger:
U-boot#
According to "Mastering Embedded Linux Programming" (Chris Simmonds), it is possible. In one of my previous emails, I posted a screenshot of this book, which shows the approach.
Pavel47
 
Posts: 8
Joined: Sat Aug 29, 2020 2:06 pm
Top

Re: Can't boot from sd-card on BeagleBone Black

Postby summers » Mon Aug 31, 2020 8:35 am

$this->bbcode_second_pass_quote('', 'I')n my current exercises I have no plan to boot OS, just pass two stages of the bootloader (MLO and u-boot.img) and stop.

Strange thing is, you have pretty much already done this:
$this->bbcode_second_pass_code('', 'U-Boot SPL 2020.10-rc3-00012-g9f04a634ef (Aug 29 2020 - 11:40:17 +0200)
U-Boot 2020.10-rc3-00012-g9f04a634ef (Aug 29 2020 - 11:40:17 +0200)')
The first line is produced by the SPL, also called MLO in the Ti boot process.
The second line is produced by the main uboot.

Anyway since 2017 uboot has moved on. distro became the default on many boards, and it fairly aggressively looks for an OS on the machine. This makes it fairly easy for OS to ask for uboot to boot them. Now in your case distro has said:
$this->bbcode_second_pass_code('', 'Scanning mmc 1:1...
Found /boot/extlinux/extlinux.conf')
So it thinks its found an extlinux.conf - and looks like its stalled trying to boot from it.

Now you say you don't want to boot an OS, in which case distro isn't helping you, but making things worse. Well in that case just edit am335x_evm_defconfig and remove distro. Now uboot will still run various commands, see:
https://gitlab.denx.de/u-boot/u-boot/-/blob/master/include/configs/am335x_evm.h
But don't think any of this will stop you getting to the prompt.

Oh yes - worth saying, this is the Arch Arm forum, so specifically its for the Arch OS on the arm platform. As you aren't interested in Arch, you problem isn't really for here. Probably would be better on the uboot mail list.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm
Top

Re: Can't boot from sd-card on BeagleBone Black

Postby Pavel47 » Mon Aug 31, 2020 8:56 am

Thanks,

Can you just answer me the following question:
Is it possible to boot without having kernel on sd-card ?


$this->bbcode_second_pass_quote('', 'S')o it thinks its found an extlinux.conf - and looks like its stalled trying to boot from it.

Because failing to boot from sd-card it switches to eMMC, where this file, indeed, does exist.
I want BBB don't switch to eMMC. Chris Simmonds described the approach in his book: he succeeded to boot having only two boot files on sd-card and nothing else.


$this->bbcode_second_pass_quote('', 'B')ut don't think any of this will stop you getting to the prompt.

Here I didn't understand what you mean.


$this->bbcode_second_pass_quote('', 'A')s you aren't interested in Arch, you problem isn't really for here. Probably would be better on the uboot mail list.

It's already done (I mean uboot mail list), but have no answer since one day. Concerning this forum, since there is "u-boot" section on this forum, I thought I might have some help on this topic.

Sincerely,

Pavel.
Pavel47
 
Posts: 8
Joined: Sat Aug 29, 2020 2:06 pm
Top

Re: Can't boot from sd-card on BeagleBone Black

Postby summers » Mon Aug 31, 2020 9:28 am

Well depends on what you mean by "boot", to most people it means boot an OS, and yes you can only boot an OS, with a kernel and its operating system installed.

But this isn't what you want to do.

Problem is your questions are now getting very technical. Yes they have answers, but the answers are complicated, and hidden deep in the uboot source code. Now uboot evolves slowly, and generally it does support boards in a good way; so changes made there are made for a reason. In this case, uboot looked for a way to boot, and it found one. Its just one you didn't want it to find. Now can we blame uboot for that.

Now if you want 2017 uboot behavior, you could just download that source, and use it - but where is this going. You probably have a reason for wanting uboot to drop out to a prompt, but why you haven't explained. Maybe its school homework, but if so you will already get a good mark, so don't stress. Maybe you want to install a totally different OS, say hurd or something weird like that; we if so then thats what you should look into. But whats clear is you probably don't what to watch a "Boot>" prompt, I know its what you've said you want, but its not an end in itself - and that what you need to focus in on, where you are going, not where you are now.

For me, uboot in this case is doing what it should be doing, so what we are doing is is just chatting round the subject, and noone really benefits.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Next

Return to U-Boot/Kernel

Who is online

Users browsing this forum: No registered users and 5 guests