I am using Yocto to generate a customized Linux version for my BeagleBone board.
I can flash this image to the internal emmc on the board via an external SD card and it runs fine. In order to flash it, I hold down the boot button when the board boots up, which flashes the image from the SD card into the internal emmc memory.
The one problem however I have now is that if I want to re-flash another custom image after this onto the board the same way, it doesn't work unless I first flash a default Debian image for the BeagleBone (provided on the BeagleBone site). The serial debug outputs under different scenarios are below.
Would anyone know what is the problem here?
My understanding is that the ROM bootlader provided by TI is the very first thing to get executed when the board starts and this code never changes. This ROM bootlader checks if the boot button is pressed and decides where to boot from.
Why would it make a difference which kernel version is currently flashed on the board, and why is the re-flashing only working when a default Debian image is loaded on there and not my customized Yocto image?
Messages from SPL and U-boot over serial when booting up on different scenarios :
Normal output from custom image booting from internal emmc:
U-Boot SPL 2016.05-g4db46a6bbd (Oct 01 2018 - 11:17:40)
Trying to boot from MMC2
Card did not respond to voltage select!
*** Warning - MMC init failed, using default environment
U-Boot 2016.05-g4db46a6bbd (Oct 01 2018 - 11:17:40 +0000)
CPU : AM335X-GP rev 2.1
Watchdog enabled
I2C: ready
DRAM: 512 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Net: Could not get PHY for cpsw: addr 0
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
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
750 bytes read in 5 ms (146.5 KiB/s)
Loaded env from uenv.txt
Importing environment from mmc1 ...
Running uenvcmd ...
reading //zImage
9479464 bytes read in 536 ms (16.9 MiB/s)
reading zImage-am335x-bonegreen-wireless.dtb
64415 bytes read in 10 ms (6.1 MiB/s)
debug: [console=tty0 console=ttyO0,115200n8 root=/dev/mmcblk1p2
rootfstype=ext4 rootwait quiet systemd.show_status=0] ...
debug: [bootz 0x82000000 0x88080000: 0x88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0x90a528 ]
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Using Device Tree in place at 88000000, end 88012b9e
Starting kernel ...
[ 0.000932] clocksource_probe: no matching clocksources found
[ 0.769837] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[ 1.039034] omap_voltage_late_init: Voltage driver support not added
[ 1.046157] PM: Cannot get wkup_m3_ipc handle
[ 1.140466] bone_capemgr bone_capemgr: slot #0: No cape found
[ 1.171664] bone_capemgr bone_capemgr: slot #1: No cape found
[ 1.204470] bone_capemgr bone_capemgr: slot #2: No cape found
[ 1.235544] bone_capemgr bone_capemgr: slot #3: No cape found
systemd 219 running in system mode. (-PAM -AUDIT -SELINUX +IMA -APPARMOR
+SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP
+BLKID -ELFUTILS +KMOD -IDN)
Detected architecture arm.
Set hostname to <lGW>.
[/lib/systemd/system/sensormagenetic.service:1] Assignment outside of
section. Ignoring.
[/lib/systemd/system/sensormagenetic.service:2] Assignment outside of
section. Ignoring.
[/lib/systemd/system/sensormagenetic.service:3] Assignment outside of
section. Ignoring.
[/lib/systemd/system/routemanager.service:1] Assignment outside of section.
Ignoring.
[/lib/systemd/system/routemanager.service:2] Assignment outside of section.
Ignoring.
[/lib/systemd/system/routemanager.service:3] Assignment outside of section.
Ignoring.
[/lib/systemd/system/button.service:1] Assignment outside of section.
Ignoring.
[/lib/systemd/system/button.service:2] Assignment outside of section.
Ignoring.
[/lib/systemd/system/button.service:3] Assignment outside of section.
Ignoring.
Cannot add dependency job for unit resin-device-uuid.service, ignoring: Unit
mnt-boot.mount failed to load: No such file or directory.
[ 23.746044] wlcore: ERROR could not get configuration binary ti-
connectivity/wl18xx-conf.bin: -2
Resin OS (resin-os)
Flashing a default Debian image over the custom image (it flashes fine) :
U-Boot SPL 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500)
Trying to boot from MMC1
Loading Environment from EXT4... ** File not found /boot/uboot.env **
** Unable to read "/boot/uboot.env" from mmc0:1 **
U-Boot 2018.09-00002-g0b54a51eee (Sep 10 2018 - 19:41:39 -0500), Build:
jenkins-github_Bootloader-Builder-65
CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... ** File not found /boot/uboot.env **
** Unable to read "/boot/uboot.env" from mmc0:1 **
Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
Model: SeeedStudio BeagleBone Green Wireless:
BeagleBone: cape eeprom: i2c_probe: 0x54:
BeagleBone: cape eeprom: i2c_probe: 0x55:
BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net: eth0: MII MODE
Could not get PHY for cpsw: addr 0
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
board_name=[A335BNLT] ...
board_rev=[GW1A] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
2098 bytes read in 79 ms (25.4 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.14.71-ti-r80 ...
10416640 bytes read in 718 ms (13.8 MiB/s)
debug: [enable_uboot_overlays=1] ...
Attempting to flash a custom image over a custom image (It doesn't flash):
U-Boot SPL 2016.05-g4db46a6bbd (Oct 01 2018 - 11:17:40)
Trying to boot from MMC1
Card doesn't support part_switch
MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment
U-Boot 2016.05-g4db46a6bbd (Oct 01 2018 - 11:17:40 +0000)
CPU : AM335X-GP rev 2.1
Watchdog enabled
I2C: ready
DRAM: 512 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Net: Could not get PHY for cpsw: addr 0
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
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
750 bytes read in 4 ms (182.6 KiB/s)
Loaded env from uenv.txt
Importing environment from mmc1 ...
Running uenvcmd ...
reading //zImage
9479464 bytes read in 535 ms (16.9 MiB/s)
reading zImage-am335x-bonegreen-wireless.dtb
64415 bytes read in 11 ms (5.6 MiB/s)
debug: [console=tty0 console=ttyO0,115200n8 root=/dev/mmcblk1p2
rootfstype=ext4 rootwait quiet systemd.show_status=0] ...
debug: [bootz 0x82000000 0x88080000: 0x88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0x90a528 ]
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Using Device Tree in place at 88000000, end 88012b9e
Starting kernel ...
[ 0.000934] clocksource_probe: no matching clocksources found
[ 0.769829] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[ 1.039161] omap_voltage_late_init: Voltage driver support not added
[ 1.046307] PM: Cannot get wkup_m3_ipc handle
[ 1.140455] bone_capemgr bone_capemgr: slot #0: No cape found
[ 1.171521] bone_capemgr bone_capemgr: slot #1: No cape found
[ 1.204295] bone_capemgr bone_capemgr: slot #2: No cape found
[ 1.236726] bone_capemgr bone_capemgr: slot #3: No cape found
systemd 219 running in system mode. (-PAM -AUDIT -SELINUX +IMA -APPARMOR
+SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP
+BLKID -ELFUTILS +KMOD -IDN)
Detected architecture arm.
Set hostname to <lGW>.
[/lib/systemd/system/sensormagenetic.service:1] Assignment outside of
section. Ignoring.
[/lib/systemd/system/sensormagenetic.service:2] Assignment outside of
section. Ignoring.
[/lib/systemd/system/sensormagenetic.service:3] Assignment outside of
section. Ignoring.
[/lib/systemd/system/routemanager.service:1] Assignment outside of section.
Ignoring.
[/lib/systemd/system/routemanager.service:2] Assignment outside of section.
Ignoring.
[/lib/systemd/system/routemanager.service:3] Assignment outside of section.
Ignoring.
[/lib/systemd/system/button.service:1] Assignment outside of section.
Ignoring.
[/lib/systemd/system/button.service:2] Assignment outside of section.
Ignoring.
[/lib/systemd/system/button.service:3] Assignment outside of section.
Ignoring.
Cannot add dependency job for unit resin-device-uuid.service, ignoring: Unit
home-root-.rnd.mount failed to load: No such file or directory.
[ 25.644826] wlcore: ERROR could not get configuration binary ti-
connectivity/wl18xx-conf.bin: -2
Resin OS (resin-os)
Flashing a custom image over a Debian image (this flashes fine) :
U-Boot SPL 2016.05-g4db46a6bbd (Oct 01 2018 - 11:17:40)
Trying to boot from MMC1
Card doesn't support part_switch
MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment
U-Boot 2016.05-g4db46a6bbd (Oct 01 2018 - 11:17:40 +0000)
CPU : AM335X-GP rev 2.1
Watchdog enabled
I2C: ready
DRAM: 512 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Net: Could not get PHY for cpsw: addr 0
cpsw, 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
reading boot.scr
** Unable to read file boot.scr **
reading uenv.txt
750 bytes read in 7 ms (104.5 KiB/s)
Loaded env from uenv.txt
Importing environment from mmc0 ...
Running uenvcmd ...
reading //zImage