Where is Angstrom-Linux stored?

Hi,

I have a general problem in understanding the BBB and its boot process. With factory defaults BBB starts Angstrom Linux on power-up - correct?

Now when one connects this board via USB and with no micro-SD-card plugged to a host computer, a drive is shown there which contains some files (MLO bootloader u-boot.img and some documentation). So my question here: where are these things stored? And where is the Linux-filesystem stored which does not appear within this drives data?

I’d assume it has something to do with internal NAND-flash…but in this case the boot procedure of BBB is not clear to me - is the CPU itself able to read a FAT-formatted filesystem to start the MLO-bootloader? Or how else is booting done in this configuration?

Thanks!

Hi, Satz

The Angstrom distribution create a FAT partition on the internal NAND-Flash and have a gadget to share this partition as USB disk.

Others partitions are not available as USB disk.

The best way to understand is to plug mouse, keyboard and screen and use the Gnome disk explorer.

Regards

Hi,

I have a general problem in understanding the BBB and its boot process. With factory defaults BBB starts Angstrom Linux on power-up - correct?

Now when one connects this board via USB and with no micro-SD-card plugged to a host computer, a drive is shown there which contains some files (MLO bootloader u-boot.img and some documentation). So my question here: where are these things stored? And where is the Linux-filesystem stored which does not appear within this drives data?

I’d assume it has something to do with internal NAND-flash…but in this case the boot procedure of BBB is not clear to me - is the CPU itself able to read a FAT-formatted filesystem to start the MLO-bootloader? Or how else is booting done in this configuration?

BBB can boot from several sources, but I’ll restrict this explanation to the internal eMMC and the SDCard. uBoot considers the SDCard to be MMC 0 and the eMMC is considered MMC 1. Both devices are configured the same; namely a small FAT partition which stores MLO (first stage loader), u-boot (second stage loader) and uImage (Linux Kernel); and a second partition formatted as EXT4 which contains the linux filesystem. When you first boot, you will see u-boot countdown (“Hit any key to stop autoboot”) which requires you to press any key to enter the u-boot prompt. At the u-boot prompt, enter the following command:

U-Boot# printenv

This line is probably the most important to understand how BBB boots:

bootcmd=gpio set 53; i2c mw 0x24 1 0x3e; run findfdt; mmc dev 0; if mmc rescan ;

then echo micro SD card found;setenv mmcdev 0;else echo No micro SD card found,

setting mmcdev to 1;setenv mmcdev 1;fi;setenv bootpart ${mmcdev}:2;mmc dev ${mm

cdev}; if mmc rescan; then gpio set 54; echo SD/MMC found on device ${mmcdev};if

run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv

;fi;if test -n $uenvcmd; then echo Running uenvcmd …;run uenvcmd;fi;gpio set 5

5; if run loaduimage; then gpio set 56; run loadfdt;run mmcboot;fi;fi;

U-Boot# gpio set 53
sets LED0 (D2)

U-Boot# run findfdt
runs the following command:

findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi;

if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; i

f test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $

board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi

which determines the board type, in this case fdtfile=am335x-boneblack.dtb

Next, mmc is set to dev 0 (mmc dev 0), which is the SDCard. (mmc rescan) checks to see if the SDCard is installed and if it is, mmcdev=0 (setenv mmcdev 0) and if not, mmcdev is set to 1 (setenv mmcdev 1). Next, bootpart is set to 0 if the SDCard is installed; otherwise, it is set to 1.

I won’t go into detail for the remainder, but you can now see that the following commands are run:
U-Boot# run loadbootenv //loads uEnv.txt into memory
U-Boot# run importbootenv //imports uEnv.txt from memory into the u-boot env
U-Boot# run loaduimage // load uImage into memory
U-Boot# run loadfdt // load devicetree
U-Boot# run mmcboot // runs the linux kernel

BTW, you could always enter these commands individually and if you do this correctly, you will boot the BBB successfully.

It is the linux kernel that mounts the second partition (ext4) which contains the filesystem and then the init scripts are run to configure and setup everything needed for device drivers, display a login console and present a graphical environment available.

This is a very brief description, but I hope it is enough to help you understand the remainder of the u-boot environment and see how it works.

Regards,
John

John,

thanks for your detailled answer

BBB can boot from several sources, but I’ll restrict this explanation to the
internal eMMC and the SDCard. uBoot considers the SDCard to be MMC 0 and the
eMMC is considered MMC 1. Both devices are configured the same; namely a
small FAT partition which stores MLO (first stage loader)

So the (let me call it) "internal MLO" is not stored on NAND-flash as
mentioned before but on a FAT-partition of eMMC?

Assumed my internal MLO got lost for some reason and I only can boot
some own (bare-metal) applications from external SD-card, is there a
way to access or restore that internal FAT-partition without using a
full Linux-installation on my SD card? A OpenOCD JTAG debugger would
be available...

Thanks!

John,

thanks for your detailled answer

BBB can boot from several sources, but I¹ll restrict this explanation
to the
internal eMMC and the SDCard. uBoot considers the SDCard to be MMC 0
and the
eMMC is considered MMC 1. Both devices are configured the same; namely a
small FAT partition which stores MLO (first stage loader)

So the (let me call it) "internal MLO" is not stored on NAND-flash as
mentioned before but on a FAT-partition of eMMC?

I¹m not sure I understand what you are saying, but there is no separate
NAND-Flash. There is only eMMC which you partition and format just like
any other block device. The MLO is stored on the FAT partition.

Assumed my internal MLO got lost for some reason and I only can boot
some own (bare-metal) applications from external SD-card, is there a
way to access or restore that internal FAT-partition without using a
full Linux-installation on my SD card? A OpenOCD JTAG debugger would
be available...

If you don¹t have MLO on the eMMC, then you should press and hold the boot
button while applying power, which will read the MLO on the SDCard. To
restore the eMMC contents look at this page:

http://www.elinux.org/Beagleboard:Updating_The_Software

Regards,
John

So the (let me call it) "internal MLO" is not stored on NAND-flash as
mentioned before but on a FAT-partition of eMMC?

I¹m not sure I understand what you are saying, but there is no separate
NAND-Flash. There is only eMMC which you partition and format just like
any other block device. The MLO is stored on the FAT partition.

The AM3358 itself comes with ain (internal) NAND-Flash. So to sum it
up, it is definitely not used for booting, only eMMC (an CPU-external
flash chip) or optional, external SD-card are used for this.

If you don¹t have MLO on the eMMC, then you should press and hold the boot
button while applying power, which will read the MLO on the SDCard.

This also works without pressing this button, when the MLO on eMMC
does not exist it boots external automagically.

To
restore the eMMC contents look at this page:

Beagleboard:Updating The Software - eLinux.org

Thanks :slight_smile: