Reflash BBG

Reflashing an embedded device wipes the device clean and gets it back to its "factory" default state. When we reflash a board, we select an image, which is the version of the software (called the firmware) to install.

When you buy a new hardware kit, it should have the correct image installed already. If you are getting a board from a friend you will likely need to reflash it. You may also need to reflash the board if the board somehow gets corrupted and will not boot (unusual).

1. Create Bootable microSD

  1. Download the desired BBG image from these sources. Suggest getting the "Minimal" image.
  2. Install the Etcher program on your PC (Windows, Mac, Linux) (once installed, it's called "balenaEtcher")
  3. Insert your 4GB (or bigger) microSD card into your computer's card reader
  4. Run Etcher:
    • Select "Flash from file", select the file to burn (may be a .xz archive or .img image).
    • Select your microSD card as the target (card will be fully erased)
    • Click "flash" to write the image to your SD card (may take ~5 minutes)

2. Make microSD a "Flasher"

Directions for the 11.3 or newer image:

  1. Unplug micro-USB cables from your BBG to power it down
  2. Insert your bootable microSD card (which you created above) into your BBG
  3. While pressing and holding the "USER" button on the BBG (just above the microSD card reader, beside the P8 header, you may need a pen to push the button around the Zen cap), plug in the micro-USB cable to power up the board
    • After a few seconds, once the BBG's blue lights are flashing, you can release the button.
    • Note that pressing the button is only necessary when wanting to run UBoot on the microSD card, which is a safe default choice.
  4. Connect to board via SSH
    • It may take a little longer for the BBG to boot from the microSD card than normal.
    • Note that if you had previously connected to your BBG, SSH is likely to fail to connect due to security ("WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"). Use the command from SSH's outputs (ssh-keygen -f...) to remove the SSH key for the previous board.
    • Connection command likely: ssh debian@192.168.7.2
    • Default password likely: temppwd
    • See the quick start guide for details. Note that you cannot use sshpass to connect here because it has a new fingerprint, so you must use ssh.
  5. Convert the booted uSD card into a flasher:
    sudo enable-beagle-flasher
    Default root password is temppwd
    WARNING: Don’t run this command on your BBG when you have booted from the onboard eMMC. It will make your board unbootable and require you to reflash your board from a microSD card.

WARNING: This microSD card is now a flasher: it will re-flash any BBG you boot off of it without warning! "With great power comes great responsibility."

Directions for the 10.3 or older image:

  1. Unplug micro-USB cables from your BBG to power it down
  2. Insert your bootable microSD card into your BBG
  3. Plug in the micro-USB cable to power up the board
  4. Connect to board via SSH
    • It may take a little longer for the BBG to boot from the microSD card than normal.
    • Note that if you had previously connected to your BBG, SSH is likely to fail to connect due to security ("Identification has changed"). Use the command from SSH's outputs to remove the SSH key for the previous board.
    • Connection command likely: ssh debian@192.168.7.2
    • Default password likely: temppwd
    • See the quick start guide for details
  5. Change the boot script on the microSD card to make the card re-flash the BBG on boot
    • Edit the /boot/uEnv.txt file from your SSH session to the board:
      sudo nano /boot/uEnv.txt
      This will ask you your password, which is likely temppwd
    • Remove the # from the start of the last line in the file.
    • Close and save using Ctrl X, answer Y to save file.
    • Check file is correct using
      cat /boot/uEnv.txt
      End of file should look like:
      ##enable Generic eMMC Flasher:
      ##make sure, these tools are installed: dosfstools rsync
      cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
    • WARNING: This microSD card is now a flasher: it will re-flash any BBG you boot off of it.


3. Reflash Your BBG

  1. Unplug the micro-USB cables from your BBG to power it down
  2. (Optional) If you want to see the output of the reflashing process, connect via serial to the BBG
  3. Insert your bootable flasher microSD card into your BBG
  4. While pressing and holding the "USER" button on the BBG (just above the microSD card reader, beside the P8 header), plug in the micro-USB cable to power up the board
    • After a few seconds, once the lights are flashing, you can release the button.
    • Note that pressing the button is only necessary when wanting to run UBoot on the micor-SD card, which is a safe default choice.
  5. After ~1 minute the BBG's LEDs will bounce back-and-forth while it re-flashes your BBG. This can take 10+ minutes.
    • If it does not start bouncing the LEDs, double check the steps above.
  6. Once done, it will power off your BBG (all LEDs off)
  7. Unplug BBG, remove the flasher microSD card, and reboot your board
  8. Check the version of your board via SSH:
    • cat /ID.txt should show BeagleBoard.org Debian XXXX Image YYYY-MM-DD corresponding to the image you flashed.
    • Note that when you SSH into the board after you reflashed it, it will have a new identity, so you'll need to use SSH's suggested command to forget the previous board.

Resources