Yocto boot beaglebone green wifi.

Hi all,
I use Yocto to create image and boot beaglebone green wifi. like this introdctuion:
https://embeddedguruji.blogspot.com/2019/04/steps-to-build-and-flash-yocto-image-on.html

After flash process, board turn down, but it’s still old image. Please help thank in advance.
Step1: Create a folder for Yocto source code:
$ mkdir beagblebone_yocto && cd beagblebone_yocto

Step2: Clone the poky source code:
$ git clone -b thud git://git.yoctoproject.org/poky.git

Step3: Run the environment script to setup the Yocto Environment and create build directory
$ source poky/oe-init-build-env build

Step4: Set the MACHINE variable to ‘beaglebone-yocto’
$ echo ‘MACHINE = “beaglebone-yocto”’ > conf/local.conf

Step5: Build the core-image-minimal image
$ bitbake core-image-minimal

After a few hours, you will find the images will be present in beaglebone_yocto/build/tmp/deploy/images/beaglebone-yocto folder

Step6: Take memory card and make two partitions using gparted:
Partition1 : Size 100 MB, fat16 (boot flag)
Partition2: Size > 2GB , ext4

Step7: Copy the files in the required partition.
$ cd beaglebone_yocto/build/tmp/deploy/images/beaglebone-yocto
$ cp MLO-beaglebone-yocto /media/jamal/boot/MLO
$ cp u-boot.img /media/jamal/boot/u-boot.img
$ sudo tar -xf core-image-minimal-beaglebone-yocto.tar.bz2 -C /media/jamal/rootfs

Step8: Connect the Micro SD Card to the beaglebone black and to boot from MicroSD press the User Button(S2) While applying power.

were you able to resolve your issue?

The instructions below do not flash the onboard eMMC.
So you will need to press the button every time to force booting from the SD card.

You probably want to use dd.

“After flash process, board turn down, but it’s still old image.”

BBGW will boot from eMMC by default.

“to boot from MicroSD press the User Button(S2) While applying power”

This is important but ambiguous.

The button to push is the BOOT button near the Grove connectors and the antennas.

You must hold down BOOT, then remove USB power then re-insert USB power then release BOOT button.

BBGW System Reference Manual has the details:

A switch is provided to allow switching between the modes.

Holding the boot switch down during a removal and reapplication of power
without a microSD card inserted will force the boot source to be the USB port
and if nothing is detected on the USB client port, it will go to the serial port for
download.

Without holding the switch, the board will boot try to boot from the eMMC. If
it is empty, then it will try booting from the microSD slot, followed by the serial
port, and then the USB port.

If you hold the boot switch down during the removal and reapplication of power
to the board, and you have a microSD card inserted with a bootable image, the
board will boot from the microSD card.

NOTE: Pressing the RESET button on the board will NOT result in a change of the boot
mode. You MUST remove power and reapply power to change the boot mode. The
boot pins are sampled during power on reset from the PMIC to the processor. The
reset button on the board is a warm reset only and will not force a boot mode change.

Regards,
Dave

My observations are if you hook up the debug console port and boot
from eMMC (i.e. not holding BOOT button) you will see something like:

U-Boot SPL 2019.04-00002-gbb4af0f50f (Jul 08 2019 - 11:44:39 -0500)
Trying to boot from MMC2

and if you do boot from sdcard by holding the BOOT button then
removing and inserting the USB/power cable you see:

U-Boot SPL 2020.01-rc3 (Nov 19 2019 - 02:31:49 +0000)
Trying to boot from MMC1

My observation is that you will see:

Loading Environment from FAT…

if your u-boot expects to have a FAT file system for boot, and:

Loading Environment from EXT4…

if your u-boot expects to have an EXT4 file system for boot.

It seems the yocto u-boot still expects a FAT file system for boot,
whereas the debian/beaglebone.org one expects EXT4.

I suppose I could confirm this by reformatting my sdcard with
FAT file system for boot.

I am able to boot my yocto build with one EXT4 partition on sdcard
by interrupting u-boot at startup and doing the following in u-boot:

setenv loadzimage “load mmc 0:1 ${loadaddr} /boot/zImage”
setenv loadftd “load mmc 0:1 ${fdtaddr} /boot/am335x-boneblack.dtb”
setenv bootargs “console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait fixrtc ${optargs}”
run loadzimage
run loadftd
bootz ${loadaddr} - ${fdtaddr}

Comments?
Dave

It seems the yocto u-boot still expects a FAT file system for boot,
whereas the debian/beaglebone.org one expects EXT4.

I suppose I could confirm this by reformatting my sdcard with
FAT file system for boot.

I did this by doing lab 1 in Bootlin – Embedded Linux and kernel engineering

It appears the u-boot in yocto still expects the fat file system.

Or maybe there are fall back paths where either can work?

Bottom line is you should be able to get yocto to work if you follow the slides/pdfs in that directory.

Feel free to ask any questions since I was just able to do lab 1 with no issues on BBGW.

Thanks,
Dave

Maybe uboot supports it but it is not configured.

https://stackoverflow.com/questions/47047209/how-to-change-the-config-of-u-boot-in-yocto

Thanks, Hugo, I think you are right, both are probably supported and the difference probably is in how u-boot is configured.

Thanks for the link, it is very helpful.

Regards,
Dave