• SoftwareSolved
  • Boot problem - Bela cannot boot, after image & eMMC update

Right, so I worked with one Bela, that I've upgraded to "Bela image, v0.3.6b, 23 October 2018"; had to do the https://github.com/BelaPlatform/Bela/wiki/Manage-your-SD-card#option-2 - and the procedure completed, it booted fine, no problem there.

Now, I'm trying to do the same on another Bela, and unfortunately, after completing the same process, this Bela does not want to boot anymore. I cannot recall what the working Bela was, -- but I'm pretty sure it's the same as this one, that doesn't boot, which is:

  • 03/16 rev. B1 cape
  • BeagleBoard.org - BeagleBone Black - cannot tell what the revision is, but the User Button is labeled "S2"

Anyways, this is the process I went through - using Ubuntu 18.04 as desktop/host OS:

First, I I removed SD card, booted as per https://github.com/BelaPlatform/Bela/wiki/Manage-your-SD-card#option-1 - got to this:

$ ssh root@192.168.7.2
...
Debian GNU/Linux 7

BeagleBoard.org Debian Image 2015-11-12

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

Last login: Thu Nov 12 19:00:03 2015
root@beaglebone:~#

So, since "if the eMMC contains a beagleboard.org image, do ssh debian@beaglebone.local" - and it is a BeagleBoard.org Debian Image, I exited, and tried again (after removing keys with ssh-keygen -f):

$ ssh debian@beaglebone.local
...
Debian GNU/Linux 7

BeagleBoard.org Debian Image 2015-11-12

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

debian@beaglebone.local's password:
debian@beaglebone:~$

Also, I think at this point I got a /media/BEAGLEBONE partition automounted in Ubuntu.

Ok, once that I confirmed this, I proceeded with https://github.com/BelaPlatform/Bela/wiki/Manage-your-SD-card#option-1 :

debian@beaglebone:~$ sudo dd if=/dev/zero of=/dev/mmcblk1p1 bs=1024k count=50
dd: writing `/dev/mmcblk1p1': No space left on device
11+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.128818 s, 81.4 MB/s

Then, as per instructions "insert SD card and reboot. It will boot from the SD card" - did so, but it didn't boot. (Btw, the same thing happened on the first Bela, that ended up being flashed succesfully).

So, I proceed with https://github.com/BelaPlatform/Bela/wiki/Manage-your-SD-card#option-2

  • remove the Bela cape (see here)
  • insert the SD card in the slot
  • press the "USER" button on the BeagleBone (at the back just above the SD card slot) and hold it while powering up the Beaglebone.

It booted; got /media/BELABOOT partition automounted on PC. Opened a web browser on http://192.168.7.2 ; and from the Bela IDE, I ran /opt/Bela/bela_flash_emmc.sh; process started, and after some minutes, completed with:

...
+ cp -a /opt/Bela/uEnv-emmc.txt /mnt/emmc_boot/uEnv.txt
+ cp -a /bin/ /boot/ /dev/ /etc/ /home/ /lib/ /opt/ /root/ /sbin/ /srv/ /usr/ /var/ /mnt/root     # hangs here for a while
...
+ rm /mnt/root/etc/systemd/system/default.target.wants/bela_flash_emmc.service
rm:
cannot remove '/mnt/root/etc/systemd/system/default.target.wants/bela_flash_emmc.service': No such file or directory
+ true
+ rm /mnt/root/etc/cpsw_0_mac /mnt/root/etc/cpsw_1_mac /mnt/root/etc/cpsw_2_mac /mnt/root/etc/cpsw_3_mac /mnt/root/etc/cpsw_4_mac /mnt/root/etc/cpsw_5_mac
+ sync
+ umount /mnt/emmc_boot
+ umount /mnt/root
+ echo 'Done!'
+ echo mmc0
+ echo none
+ echo mmc1
Done!
+ SUCCESS=1
+ final_check
+ '[' 1 -eq 0 ']'
root@bela ~/Bela#

Then, as per the instructions:

  • power off the board and put the Bela cape back on
  • power on the board. It should now successfully boot from the SD card without need to press the USER button.

At this point, my first (working) Bela did reboot - but the current one did not.

So, I checked the SD card on the PC, it automounts two partitions:

/media/BELABOOT
/media/BELAROOTFS

... the same I got with the working Bela, too.

Then I removed the cape again, booted with S2/USER button again, it boots again, /media/BELABOOT automounts on PC, and I did:

$ ssh debian@beaglebone.local
ssh: Could not resolve hostname beaglebone.local: Name or service not known

$ ssh root@192.168.7.2

The programs included with the Debian GNU/Linux system are free software;
...
Bela image, v0.3.6b, 23 October 2018
....

So, I did the following:

  • Without cape, without SD card, no S2/USER: I just get /media/BELABOOT automounted on PC, and LEDs D2, D3 and D4 shine constantly, and there the boot process stops...
  • Without cape, without SD card, S2/USER pressed: only PWR LED shines, no other - no LED blink activity...
  • Cape, without SD card, no S2/USER: same thing: I just get /media/BELABOOT automounted on PC, and LEDs D2, D3 and D4 shine constantly, and there the boot process stops...
  • Cape, without SD card, S2/USER pressed: only PWR LED shines, no other - no LED blink activity...
  • Cape, with SD card, no S2/USER: same thing: I just get /media/BELABOOT automounted on PC, and LEDs D2, D3 and D4 shine constantly, and there the boot process stops...
  • Cape, with SD card, S2/USER pressed: only PWR LED shines, no other - no LED blink activity...

I'm kind of puzzled that this happened - especially since I've already went through the same process, on likely the same type of Bela, and it worked. So, what can I do to troubleshoot this, and to get this Bela to boot again?

    Hmm one possibility is that this BeagleBone is an older version, with a 2GB eMMC. This means that the flashing procedure was not successful. This is a bit weird, because that should have had been reported as an error from the bela_flash_emmc.sh script, which instead exited successfully according to the log above.

    sdaau Without cape, without SD card, no S2/USER: I just get /media/BELABOOT automounted on PC, and LEDs D2, D3 and D4 shine constantly, and there the boot process stops...

    This denotes an issue with the eMMC.
    what do you mean "shine constantly"? Are they solid on or do they blink?

    sdaau Without cape, without SD card, S2/USER pressed: only PWR LED shines, no other - no LED blink activity...

    expected: button means "boot from SPI and then SD card", but there is no SD card, and nothing good on the SPI bus

    sdaau Cape, without SD card, no S2/USER: same thing: I just get /media/BELABOOT automounted on PC, and LEDs D2, D3 and D4 shine constantly, and there the boot process stops...

    It's expected to behave the same as case 1

    sdaau Cape, without SD card, S2/USER pressed: only PWR LED shines, no other - no LED blink activity...

    expected: to behave the same as case 2

    sdaau Cape, with SD card, no S2/USER: same thing: I just get /media/BELABOOT automounted on PC, and LEDs D2, D3 and D4 shine constantly, and there the boot process stops...

    This denotes an issue with the eMMC.

    sdaau Cape, with SD card, S2/USER pressed: only PWR LED shines, no other - no LED blink activity...

    this is probably the "SPI then SD card" boot process hanging because of a spurious signal on the SPI. That is why you should have the cape off and the SD card in when pressing USER!

    You should try to boot without cape, with SD card and USER button. This should get you into the board.

    • then, erase the beginning of the eMMC:
      dd if=/dev/zero of=/dev/mmblck1 bs=1M count=50
    • once you have done this, you should be able to reboot with the SD card and it should boot fine with the cape and without button.

    If this succeeds, let's go ahead:
    - find out the size of the eMMC: run fdisk /dev/mmcblk0 (again, the X you found above, also note it's without the trailing p1
    - run p to show the partition table and F to show the unpartitioned space. Note that the unit for sector size is 512 bytes, as fdisk reminds you:

    Sector size (logical/physical): 512 bytes / 512 bytes

    - if you find out that the size of the eMMC is about 2GB, then we solved the mystery.

    What to do when the eMMC is smaller than 2GB:

    • delete unneeded files from the SD card, for instance:
      rm -rf /opt/xenomai-3 /opt/am335x_pru_package /opt/bb.org-overlays /opt/dtb-rebuilder /var/cache /var/lib/apt/
    • run /opt/Bela/bela_flash_emmc.sh
    • cross your fingers and reboot
      a month later

      Hi @giuliomoro,

      Many thanks for your prompt response - and apologies it took me forever to respond. I'm back on this now...

      giuliomoro what do you mean "shine constantly"? Are they solid on or do they blink?

      By "shine constantly" I mean solid on (not blinking)

      giuliomoro You should try to boot without cape, with SD card and USER button. This should get you into the board.

      Did so - indeed, I got into the board

      giuliomoro then, erase the beginning of the eMMC:
      dd if=/dev/zero of=/dev/mmblk0p1 bs=1M count=50

      Ok, did that:

      $ ssh root@192.168.7.2
      ..
      Bela image, v0.3.6b, 23 October 2018
      ...
      
      root@bela:~# dd if=/dev/zero of=/dev/mmblk0p1 bs=1M count=50
      50+0 records in
      50+0 records out
      52428800 bytes (52 MB, 50 MiB) copied, 0.347843 s, 151 MB/s

      ... then plugged off USB to turn off power.

      giuliomoro once you have done this, you should be able to reboot with the SD card and it should boot fine with the cape and without button.

      Eh, unfortunately, that didn't happen. I tried to boot with SD card in, without button, - and both without, and with cape - in both cases, same result: D2, D3 and D4 are solid on, and boot process stops there...

      I'm starting to get afraid that I might have touched some static sensitive chip, and possibly destroyed it. Then again, I the boot process can still complete (and I can go in the shell) I remove the cape and press the button.

      Please let me know if there is anything else I could try. If you also suspect a hardware problem, let me know - I have an access to an oscilloscope, I could try measuring some lines/tracks/pins to assist debugging; would probably do it myself, but I don't really know the Beaglebone/Bela, so I don't really know where to start (and it could take me forever to figure out what to measure and what should I expect to see).

      Thanks again!

      sorry I think I had a typo in my previous post:

      dd if=/dev/zero of=/dev/mmblk0p1 bs=1M count=50

      should have been

      dd if=/dev/zero of=/dev/mmblck1 bs=1M count=50

      This means that you erased the boot partition on the SD card instead of the eMMC. Sorry, you will have to re-flash your SD card and try the procedure above again, with the correct command. I amended the previous post to avoid confusion.

        Many thanks for the response @giuliomoro - good news, got it to work, finally! :)

        giuliomoro sorry I think I had a typo in my previous post:

        Ok, I see - thanks for noting that.

        you will have to re-flash your SD card and try the procedure above again

        I did so - first by flashing the SD card on my PC with

        sudo dd if=/path/to/bela_image_v0.3.6b.img of=/dev/mmcblk0 bs=1024k

        Then, again: insert SD card in Beaglebone, press button, without cape - it booted; and:

        Opened a web browser on http://192.168.7.2 ; and from the Bela IDE, I ran /opt/Bela/bela_flash_emmc.sh; process started, and after some minutes, completed with:

        ...
        + SUCCESS=1
        + final_check
        + '[' 1 -eq 0 ']'
        Done!

        Then just for fun, powered it without cape, without button - and it booted!

        Then I added the cape, powered it with cape, without button - and it booted again!

        Made a quick check with "sinetone (example)" if the outputs are working - they did!

        So, now I have a live Bela again, that's great! :)

        Thanks a ton for your assistance, @giuliomoro - it was great help!