0

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
Tom Rini
  • 2,058
  • 8
  • 11
Engineer999
  • 3,683
  • 6
  • 33
  • 71
  • please clarify "it doesn't work"! What are the symptoms? What is the UART output, etc. – TBR Jan 05 '19 at 18:51
  • @TBR The UART output on bootup from the SPL is "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" – Engineer999 Jan 05 '19 at 21:09
  • @TBR "Card doesn't support part_switch" i'm trying to understand why this is. If a default Debian image is currently stored in the internal emmc, there is no problem with the partition switch. – Engineer999 Jan 05 '19 at 22:09
  • @TBR In fact this warning "Warning - MMC partition switch failed, using default environment" is happening on both normal boot from emmc and also an attempt to flash from the SD card boot. This is pointing to the problem perhaps. I'm guessing it's having problems reading the boot information from the SD card so it is defaulting to the emmc environment instead every time. – Engineer999 Jan 05 '19 at 23:14
  • trying to cram this into comments is not ideal. I hoped you'd flesh out your question with more details as to what is failing and how. Also the partition switch might not be the real issue. The eMMC has a special 'boot' partition, but the AM335x on a BBB doesn't support those. SD-cards don't have one. U-Boot in general is aware of those. – TBR Jan 06 '19 at 08:51
  • @TBR Yes, you are right. I've included the UART messages from the bootloaders (The first messages anyways) in my question under the different scenarios. It doesn't stand out to me exactly what is the issue yet. Thanks for your help. – Engineer999 Jan 06 '19 at 15:02
  • Just to be clear, the one that "doesn't flash" stalls at that exact point of output you have provided? Or is there more? – TBR Jan 06 '19 at 15:09
  • @TBR There is more. The screen fills up quickly just after that tho. It goes on to boot from the internal emmc then – Engineer999 Jan 06 '19 at 15:11
  • well, **that's** the relevant information… – TBR Jan 06 '19 at 15:20
  • @TBR I've included more of the output now and the failed flash attempt above. I've also included the output above it when a custom image is just booting normally from the internal emmc. Thanks – Engineer999 Jan 06 '19 at 15:35
  • @Engineer999 what do you mean by "flashing" in this case? You're trying to overwrite the contents of the eMMC, yes? A log of whatever commands are writing to the eMMC might help. But I don't see the failure in your failure case either, is it that it's not running the expected version? That would get back to both wanting to see the logs of flashing as well as what the expected version string would be in that case. In the failure case, are you seeing the old U-Boot used instead of the new one? Is the flashing process erasing any/all of the eMMC first? – Tom Rini Jan 10 '19 at 18:59
  • One more thing, are you doing a hard power cycle in between flashing and testing that you have what you expect? Forcing the ROM to re-read those pins, if memory serves me right, does not happen on soft reset, you need to pull power and get a cold reset to happen. – Tom Rini Jan 10 '19 at 19:02
  • @TomRini Yes. I am trying to overwrite the contents of the eMMC. Regarding seeing the old U-Boot or the new one, this is what confuses me. To re-cap. The over-writing works only in two scenarios : A : The default Debian image is on the eMMC and I am over-writing with a custom image and B: The custom image is already on eMMC and I am overwriting with a default Debian image. In both cases I wonder is it using the U-Boot from the Debian image. Other information is that the custom image has 6 separate partitions (SDL,U-Boot (has the kernel + DTB files also), RootFS, Data) – Engineer999 Jan 16 '19 at 17:33
  • @Engineer999 it would be helpful to see the entire log, including flashing output in the failure case of Custom-old to Custom-new, thanks. – Tom Rini Jan 17 '19 at 18:14

0 Answers0