u-boot can't find uEnv.txt

Hi,

I’m attempting to boot a vanilla u-boot and linux kernel from the SD card. I was able to make the cross-compiler and build from the u-boot and linux sources. I installed u-boot to the SD card via creating a FAT partition and dumping MLO and u-boot.img directly into the filesystem. I also have a minimal uEnv.txt.

So, the partition looks like this:
/MLO
/u-boot.img
/boot/uEnv.txt

I boot with the “boot-button” pressed (after disconnecting the power) and u-boot seems to fire up OK, but it complains that it can’t find uEnv.txt[1].

Questions:
(1) What are the requirements for the location of uEnv.txt?
(2) Any idea why this could be happening?
(3) Regarding installing MLO and u-boot.img, I see conflicting information. Some say just just do as I’ve done. Others use dd to directly write to the raw device. Which is correct?

Much thanks,
David

[1]Boot log:
U-Boot SPL 2016.03 (Mar 16 2016 - 11:18:49)
Trying to boot from MMC
Card doesn’t support part_switch
MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment

reading u-boot.img
reading u-boot.img

U-Boot 2016.03 (Mar 16 2016 - 11:18:49 -0700)
Watchdog enabled

I2C: ready
DRAM: 512 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Net: cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds

reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
** Unable to read file uEnv.txt **
** Invalid partition 2 **
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1…
switch to partitions #0, OK
mmc1(part 0) is current device
SD/MMC found on device 1
reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
** Unable to read file uEnv.txt **
** File not found /boot/zImage **

Error: “bootcmd_nand0” not defined

cpsw Waiting for PHY auto negotiation to complete… TIMEOUT !
BOOTP broadcast 1

Hi,

I'm attempting to boot a vanilla u-boot and linux kernel from the SD card.
I was able to make the cross-compiler and build from the u-boot and linux
sources. I installed u-boot to the SD card via creating a FAT partition and
dumping MLO and u-boot.img directly into the filesystem. I also have a
minimal uEnv.txt.

So, the partition looks like this:
/MLO
/u-boot.img
/boot/uEnv.txt

I boot with the "boot-button" pressed (after disconnecting the power) and
u-boot seems to fire up OK, but it complains that it can't find uEnv.txt[1].

Questions:
(1) What are the requirements for the location of uEnv.txt?

Look at the flow:

/uEnv.txt in the first partition...

(2) Any idea why this could be happening?
(3) Regarding installing MLO and u-boot.img, I see conflicting information.
Some say just just do as I've done. Others use dd to directly write to the
raw device. Which is correct?

Both work..

We just switched to dd'ing by default, so end users are less likely to
'soft-brick' a board when they format/delete files in the fat
partition..

Regards,

Thanks for the response, I appreciate it.

Questions:
(1) What are the requirements for the location of uEnv.txt?

Look at the flow:

http://git.denx.de/?p=u-boot.git;a=blob;f=include/configs/am335x_evm.h;h=6ebe0b3866f9b137472cc080c9eb8f1e38233186;hb=df61a74e6845ec9bdcdd48d2aff5e9c2c6debeaa#l130

/uEnv.txt in the first partition…

I tried that and no luck.

I realized that I configured u-boot with am335x_boneblack_defconfig and instead of am335x_evm_defconfig.

It also seems that u-boot will try to took for uEnv.txt in several partitions, and seeing some “** Unable to read file uEnv.txt **” messages are ok. Is this correct?

It also seems that u-boot will try to took for uEnv.txt in several partitions, and seeing some “** Unable to read file uEnv.txt **” messages are ok. Is this correct?

No. If you have an sdcard inserted at boot it will always load the first and second stage boot loaders from eMMC, but it will always look to the first partition on the sdcard for uEnv.txt.

The only exception is if S2 is depressed at boot time, then the first and second stage boot loader will be “attempted” from the sdcard first, but uEnv.txt will still be expected to exist on the sdcard.

Many people ( yours truly included ) have in the past bemoaned this behavior of uboot. When having a blank sdcard inserted at boot.

Oh, and if you’re using the eMMC only, you need to have uEnv,txt located in the first partition at root of the “drive”. So in laymen terms . . .

/uEnv.txt - Not /boot/uEnv.txt or anywhere else unless you modify uboots code before compiling.

Just to make things perhaps a little clearer . . .

william@beaglebone:~$ pwd
/home/william
william@beaglebone:~$ ls /
ID.txt boot etc lib media nfs-uEnv.txt proc run selinux sys uEnv.txt usr
bin dev home lost+found mnt opt root sbin srv tmp uEnv.txt.save var

Thank you for the clarification. I also was not setting uenvboot in my uEnv.txt. This was causing some confusion on my part. Now the board attempts to load the kernel.

Now the board gets to the kernel and hangs after “Loading Kernel Image …”. I’ll report back when/if I get this sorted out.