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.
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 :)
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:
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)
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.
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?
Ok guys,
None of the answers worked for me. But it's possible!
This is my solution:
Tools
- HP Format Utility for DriveKey
Win 32 Disk Imager
7zip
Resources
Procedure
Get Latest, currently 9.1, Debian Distro
- Download
- Unzip with 7Zip to:
bone-debian-9.1-lxqt-armhf-2017-07-30-4gb.img
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.
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
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.
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.
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.
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:
- Choose SD card with enough memory to be able to hold at least two OS img
files.
- Prepare SD Card OS (copy img there using dd linux command).
- Using fdisk create new partition using the space left and format it
- Copy img (os image) file to the newly created partition.
- Boot from SD Card
- 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)