Unable to Flash eMMC from SD Card BeagleBone Black
Asked Answered
S

9

21

I am working on BeagleBone Black and Debian running on it. I want to flash latest Debian image on my board. To do so I have downloaded a latest Debian image from link:BeagleBone Image and prepared an SD card using WinDisk image writer.

As per tutorial I have inserted an SD card into the BeagleBone Black, pressed boot button and applied power. SD card image has booted. According to the tutorial flashing eMMC takes about 30-40 minutes, so I waited for about 2 hours (just to be sure). Then I removed an SD card from my board and power it on. It booted my previous image (eMMC was not Flashed by SD card image). For flashing eMMC I am following the link: Flashing beagleBone Balck eMMC.

I am unable to understand where I am getting wrong and how to resolve it.

Suffragette answered 30/7, 2015 at 13:30 Comment(3)
It will be helpful if you show how the eMMC flashing is done.Hal
I'm having a same problem .. Did you noticed the LED's after pressing Boot key? All four LED's need to be steady during flashingLanam
@PrashantChikhalkar yes my all four leds were steady for about 2sec then I release boot buttonSuffragette
I
31

Did you remember to remove the "#" at the beginning of the line cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh ? To make this edit, which will cause the SD card to automatically flash any bbb you turn on with the SD card in it, you just need to follow these steps.
1. Connect your bbb to a power source (USB or DC work equally well)
2. Power off the bbb by pressing the power button.
3. Insert your SD card.
4. Power the bbb on.
5. Log in to SSH (I like putty for this) with port 22 and IP 192.168.7.2
6. execute: cd .. sudo nano boot/uEnv.txt
7.navigate to the line #cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh at the bottom of the txt file.
8. Delete the "#" at the beginning of the line.
9. control+x then "y" then "Enter key" to save your change and exit the txt file.
10. Reboot the BBB and the SD card should automatically flash to your BBB which will be indicated by the LED's following this pattern for (in my experience) about 10 minutes. LED pattern: 1-2-3-4-3-2-1-2-3-4-3-2-1-2-3-4-3-2-1... etc..

Hope this helps :)

Insignificancy answered 21/10, 2016 at 15:33 Comment(2)
If your on a Linux PC, you can just put the SD card in there to edit uEnv.txt. I was trying to figure out why you weren't doing that, then remembered that Windows can't read ext4.Indifferentism
I'm amazed how much time I burned on this - so many guides just say plug in the damn SD card and push the button. Ugh. One option, if you don't want to turn your SD card into a landmine, is to leave the uEnv.txt setting alone, then boot over the real RS232 serial connection (via J1 pins) and login that way, boot from SD, then run the init-eMMC-flasher-v3.sh (or whatever version) command directly. Then you can watch the progress rather than just wait around for lights to flash (so to speak) or not.Chequer
F
6

Some beagle bones are not flashing with this method (pressing down the boot/user button, plug in the 5V connector, etc..), also described in various documents (linux.org).

So, if this method also doesn't let you flash the eMMC, you could try the following:

  1. in /boot/uEnv.txt, the content is: ...

    #cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v2.sh
    

    Uncomment the last line and with the next boot, it should flash the eMMC according to the method described in the documentation (press the boot-button and then plug in the 5V connector)

  2. login to the beaglebone (this is only an example, the real devices are shown in your system and you have to find out the real device-names)

    • find out, where the root device is, for example:

      df /dev/mmcblk1p2   1855016 635552   1123568  37% /
      

      If you have booted from the SD Card, then this (/dev/mmcblk1p2) is the SD- Card partition, which is recognized by the OS.

    • find the eMMC device:

      find /dev/disk/by-path/ -ls
      

      which is showing the connected devices on your system and the paths If there is a device which differs in the name from the device, where your Root (/) is mounted, then this is the eMMC device, we are searching for, for example: /dev/disk/by-path/platform-mmc.5 -> ../../mmcblk0

    • So IF your mounted root device is: /dev/mmcblk1p2 AND your SD Card Device is: /dev/mmcblk0 then, alls you have to do is to "copy" the SD-Card content to the eMMC device:

      dd if=/dev/mmcblk0 of=/dev/mmcblk1
      

In short words: copy the SD-Card to the eMMC with the dd-command.

Floris answered 17/10, 2015 at 11:40 Comment(10)
I did the second case and it didn't work. I tried first case - it started leds flashing in sequence infinetely.Canner
@maximus, several problems could be the reason for this behaviour, not easy to check it from here. If i follow the procedure, it works as long as the beaglebone is ok. Did you pressed the boot button and plugged the 5V after that? Is it the right boot-button for your model? Or has the beaglebone some other issue?Floris
@Canner my problem is that I can never access nor see mmcblk1 when I boot from sd card. I use BBG and it can boot from SD card. After that, I connect BBG from SSH by putty. And I execute find /dev/disk/by-path/ -ls but i cannot see mmcblk1! I just see mmcblk0 which is mounted to root(sd card itself). Do you have any idea which can cause the problem?Zug
@Fer, appears mmcblk1 in /var/log/messages? If not, it is not connected to your system.Floris
@Floris sorry i check the wrong file. discard my comment before edit. i will post the file content in a few minutes.Zug
@Floris I check the file now. mmcblk1 appears like: mmcblk1: mmc1:0001 P1XXXX 3.60 GiB mmcblk1boot0: mmc1:0001 P1XXXX partition 1 2.00 MiB mmcblk1boot1: mmc1:0001 P1XXXX partition 2 2.00 MiB mmcblk1: p1 p2 mmcblk1boot1: unknown partition table mmcblk1boot0: unknown partition table Zug
@Fer, it seems, that your BBG recognizes the SD card! You have the device with two partitions on it: mmcblk1boot0 and mmcblk1boot1. if you do for example a "fsck /dev/mmcblk1" (or so) and then p, you can print the partitions. Be carefully.Floris
@Floris when i execute fsck /dev/mmcblk1 i get the following result: fsck.ext2: No such file or directory while trying to open /dev/mmcblk1. I booted with SD card. booting from sd card is not problem. The problem is that when i boot from sdcard, I cannot access mmcblk1 which is the internal memory of BBG. Without SD card, BBG can boot from the factory image also.Zug
@Floris I downloaded the newest image to my sd card. Now i can see mmcblk1. I dont know what is wrong. Now I have to update my custom sd card to the version from new image. thanxZug
@Fer, ok, good luck. Ask, if something goes wrong. Then i will start my BBB here and try to find out, what to do.Floris
B
5

Ok guys,

None of the answers worked for me. But it's possible!

This is my solution:

Tools

Resources

Procedure

  1. Get Latest, currently 9.1, Debian Distro

    • Download
    • Unzip with 7Zip to: bone-debian-9.1-lxqt-armhf-2017-07-30-4gb.img
  2. Write to SD Card

    • Format SD Card with HP Format Utility
    • Use Win 32 Disk Imager to write to SD card. This assumes your computer has a SD Card Reader and that your SD Card came with an adapter.
  3. Tweak some settings on the SD Card

    • This is probably the most obscure and undocumented part. And took me many cigarettes, and two days of yelling at my computer to figure out, but anyways.
    • Plug in the SD Card.
    • Connect the HDMI cable to a monitor.
    • Hold down the S2 Button, the only other button besides Power and Reset on BBB rev C.
    • Plug in the power source
    • Push the power button
    • Wait for Debian Stretch to boot
    • Get to a terminal

      • Leave a comment if you're not sure about how to do this and I will document it. I'm assuming most of y'all know how to do this.
      • Basically either open an SSH connection, or plug in a USB Keyboard
    • sudo nano /boot/uEnv.txt

    • Uncomment(i.e. Get rid of the #) the last line which reads:

      #cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

    • Save the file

      In nano that's Ctrl+X then y

  4. Flash the BBB

    • Power down the BBB
    • Unplug everything from the BBB. I mean everything, USB, HDMI, power, USB cables. EVERYTHING
    • Plug in the newly imaged SD Card
    • Hold down the S2 Button, the only other button besides Power and Reset on BBB rev C.
    • Plug in the Power. Make sure you have a 5V/2A power source, or it might shut down on you! I used my Samsung Galaxy Power Adapter, which happily provided both of those :).

What to expect

  • The blue lights will flash for a little bit.
  • Then they will make a very distinct up/down cycle. Akin to a progress bar.
  • Wait for the lights to all be steady and stay lit. That means that the flash was completed.
  • After this, you should be able to:
    • Power down the beagle bone, by holding the power button for 10s.
    • Remove the SD Card
    • Plug in the HDMI Monitor / Bluetooth Keyboard
    • And viola! Push the power button, and the new Debian Stretch v9.1 Should boot up in about 1 min.

Post-Install

  • If you want to start up with the SD card, for more memory, you will be forced to re-flash the device, which is inconvenient. SO to circumvent this:
  • Start up the BBB with the SD card removed
  • Mount the SD Card sudo mount /dev/mmcblk0p1 /mnt
  • sudo nano /mnt/boot/uEnv.txt
  • Append a comment to the last line of /boot/uEnv.txt, so it reads:

    #cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

  • Save and close the file.
  • sudo umount /mnt

NOTE: If any of these steps do not work for you, leave a comment and I will try my best to help you guys out.

This was a very frustrating procedure on my part, so I will do my best to help y'all out.

Beamer answered 4/8, 2017 at 15:25 Comment(0)
T
2

We have had the same problem. With a brand new BBB rev C out of the box, attempting to unpack with a valid image (it has successfully worked on other BBBs) resulted in the LEDs stalling after a few seconds. Interestingly, if you plug a serial debug cable into the board with a terminal at the other end, and attempt the flash, it complains dd: writing /dev/mmcblk1 failed - no space. So it may be that the partitioning of some boards' eMMC is such that the image fails to fit on the factory 2GB, but if the factory formatted is bigger then it will work.

Solution: run fdisk -l to find the size of the eMMC partitions. Remove the unnecessary ones till you're left with one big one. Flash from SD. Job done?

Tuneberg answered 28/1, 2016 at 14:29 Comment(0)
L
1

Assuming that you have SD card ready with the emmc flasher image for BBB, follow the below steps,

Flashing the BBB with the SD Card Image

You should perform this process with only a single 5V 2A power supply plugged into the DC jack. Alternatively, you can use a USB adapter for power. Disconnect the Ethernet cable and remove any shields and USB peripherals.

Power off your BBB by physically disconnecting the USB/power cable.

Plug the micro-SD card into the BBB’s micro-SD card slot.

Hold the Boot Button (S2) on the top right (near the SD card slot) and, while holding this button, insert the USB/power lead to connect the power.

Keep holding the button until the LEDs start to flash. The blue on-board LEDs should light in sequence and then continue to flash for the next 5–25 minutes (depending on the distribution used and the speed of the SD card).

The latest distribution flashes in a Cylon/Knightrider pattern.

Wait until the LEDs stop blinking and all 4 LEDs are fully lit (the latest image then powers the board down). This process can take 5-25 minutes depending on the image used.

If the flashing procedure fails—for example, no LEDs flash, or it keeps running for more than 45 minutes —then disconnect the power and try restarting the BBB with the S2 button pressed.

Remove the micro-SD card. This is important, as you could end up flashing the eMMC again by accident.

Finally, press the Power button (S3) to power up the board and you should have the latest image installed.

Lanam answered 11/8, 2015 at 5:48 Comment(2)
I have done the same but not getting expected resultsSuffragette
I have successfully flashed my BBB emmc with the steps specified in answer, make sure you're not missing somethingLanam
C
1

Did you ever tried to boot without holding down the boot button? This was the solution at my special BBB. It seems to me, that not really all BBBs are handling the Boot-Button in same way. If I hold down the boot button at my special BBB, nothing happens! So I tried without pressing while booting, and it works in opposite to your upper given link Flashing beagleBone Balck eMMC.

Otherwise only if you choosed the image with "..flasher..." inside of its filename flashing will happen. If you took erroneously "http://debian.beagleboard.org/images/bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img.xz" in example, then it will not flash.

Chairmanship answered 16/8, 2015 at 19:3 Comment(0)
C
1

Trying doing as its described in official step by step information, but connect DC power supply (not USB) and connect to monitor using hdmi cable to see what is happening. I struggled with the same error but after DC supply plug it worked.

If it doesn't work you could try:

  1. Choose SD card with enough memory to be able to hold at least two OS img files.
  2. Prepare SD Card OS (copy img there using dd linux command).
  3. Using fdisk create new partition using the space left and format it
  4. Copy img (os image) file to the newly created partition.
  5. Boot from SD Card
  6. And finally repeat image write on the beaglebone partition (not sd card's partition) using dd command and image from newly created partition (you have to mount it maybe)
Canner answered 24/3, 2016 at 18:55 Comment(0)
S
1

For those who still have issues, you can also try updating the flasher scripts

cd /opt/scripts/
git pull
shutdown -r now

This will update a bunch of stuff, I don't know what all it will update, but things sometimes seem to work better after ie even though I'm on Wheezy 7.10 when I apt-get update I now pull from Jessie, and things install properly. I believe that my flasher scripts on the EMMC were messed up and this may have fixed them.

This may also overwrite your /boot/uEnv.txt file with a stock / default version, so make sure to go back in and edit /boot/uEnv.txt by uncommenting the line #cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh so that your flasher will run from your SD Card/

I've been fighting trying to update my BB Black and Greens, this seems to be a necessary step for 4 of them so far, all coming from wither Wheezy 7.10 or Jessie 8.

After running it and letting it update things, power down, add SD card, hold button, add power...see what happens.

Squawk answered 30/5, 2020 at 6:39 Comment(0)
M
0

Just a remark on the thousands of tutorials out there and for those, who are very late to this as myself.

With the intention to go on BBG for a debian 11 based minimal variant, there is a tiny but very important difference: In the /boot/uEnv.txt there is now a generic eMMC-flasher in line 57:

cmdline=init=/usr/sbin/init-beagle-flasher

which activates by removing the #.

Monogamy answered 30/8, 2023 at 13:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.