Skip to content

How to flash Armbian to the eMMc of the Banana-Pi BPi-M5

The Banana-Pi BPi-M5 comes with 16 GB of embedded MultiMediaCard (eMMC) . eMMC is storage made up of NAND flash memory and a simple storage controller. Plus, it’s super fast.

Armbian, is a free open source version of Linux that runs on a number of Small Board Computers ( SMC ), offering user a choose of using Debian or Ubuntu. With the community support, Armbian offers an up-to-date operation system for a lot of systems.

A lot of people tend to use a Micro SD card because it simple and easy to setup a new SBC. But, they’re missing out on the speed that eMMC offers.

Banana-Pi has a tool that can be downloaded and used to write most images to eMMC storage, but the steps here will help with the Armbian.

First a SC Card needs to be created to boot up the BPi-M5. Use a SD card with at least 32 GB in size, this is to make sure there is enough room to download the image that will be burn into eMMC Storage.

Go the Armbian page and select one of the images that is being offered. By clicking this link, their M5 and M2P images can be downloaded.

Rapiberry Imager or Etcher can be used to burn an image into SD card.

If an image with a Desktop is used, Firefox can be use to download the image then be written to the eMMC.

If BPi-M5 is running on image with only command line support, do the following to get the image.

If a small image with only command line support was used to boot up the BPi-M5, log in from an another host via ssh. The host that is being ssh from needs to have a browser, so that the link to the image can by copied for wget. To do this, hover over over the “Direct Download”, right mouse click, and select “copy link”. For this blog post the Debian Bookworm; XFCE image will be used

cd /tmp
wget -O armbian_bookworm_xfce.img.xz https://redirect.armbian.com/region/NA/bananapim5/Bookworm_current_xfce

This will save the image in /tmp with name, armbian_bookworm_xfce.img.xz . But be warned /tmp is a tempfs meaning the image will be deleted once the BPi-M5 is rebooting. If the image is kept, save image in a different location.

Next the image needs to be decompressed, that can be done by running the following command.

xz -d -v armbian_bookworm_xfce.img.xz

Once the image is decompressed, the eMMC needs to be found. This can be done by run fdisk and listing out storage, if the correct storage is not selected, the SD card could get written over. In the image below it, show that the SD card is on mmcblk0 and the eMMC is mmcblk1. This is important because the next command will over write

sudo fdisk -l 

dd will be used to write the image to the eMMC storage. Here are some things to understand

if = the image file to be used
of = the storage to write the image too

sudo dd if=armbian_bookworm_xfce.img of=/dev/mmcblk1 bs=10M status=noxfer

This will over write every on the eMMC storage. It will take a few minutes so wait for the command prompt to return.

Once this is done. Power off the BPi-M5, and remove the SD card.

The Banana-Pi BPi-M5 is now running from the eMMC storage. Running “fdisk -l” once more will also show that the Banana-Pi BPi-M5 is running off eMMc.

Again, a simple fast way to get the BPi-M5 running on eMMC. that can be done with other Armbian iamges for the BPi-M5.

Please help support Armbian. A lot of the work is done by community members. If you would like to help, here are some links to donate and support them.



Partner
https://www.armbian.com/partners/

Community Member
https://www.armbian.com/participate/

Donate
https://www.armbian.com/donate/

The official Banana-Pi Stores on Ali Express
Banana-Pi Link 1
Banana-Pi Link 2

A third party Seller on Amazon.

Banana-Pi BPi-M5 on Amazon Prime

I like to share another site with you, James A. Chambers, he has a great script that will benchmark storage speed of the eMMC on the Banana-Pi.

Pi Benchmarks

——————– Update 9/2/23
The following is a script to help do all the steps. The script storage in the users home directory. Later I will update the script to select which image a user wants to download. It’s still being tested. Anyone welcome to help me improve it.

Copy and save this write_emmc.sh, either create a bin directory in your home directory or save under /usr/local/bin

chmod +x write_emmc.sh



#!/bin/bash
# This script is design to run from a SD Card
# If this ran from something, change the eMMC device
emmc="mmcblk1"

#The following are links that can be download it, uncomment the image that is 
# you want to burn to the emmc 
# This will later be made into a case menu, current=cli 
  
#image="https://redirect.armbian.com/bananapim5/Bookworm_current_cinnamon"
#image="https://redirect.armbian.com/region/NA/bananapim5/Bookworm_current"
image="https://redirect.armbian.com/region/NA/bananapim5/Bookworm_current_xfce"
#image"https://redirect.armbian.com/region/NA/bananapim5/Jammy_current" 
#image"https://redirect.armbian.com/region/NA/bananapim5/Jammy_current_xfce"
#image"https://redirect.armbian.com/region/NA/bananapim5/Jammy_current_gnome"

confirm() {
    while true ; do
            read -p "We need to clear the eMMC, is ok to process? (YES/NO/CANCEL) " yn
            case $yn in
                [Yy]* ) return 0;;
                [Nn]* ) return 1;;
                [Cc]* ) exit ;;
                * ) echo "Please answer Yes, No, Cancel." ;;
        esac
    done
}


if confirm; then

    # Commented out as it takes a while.
    # First we clear the emmc
    #echo "Clearing eMMC Module..this will take a while"
    #sudo dd if=/dev/zero of=/dev/$emmc

    # Second we download the latest Image"
    echo "The latest image will downloaded"
    cd ~
    wget -O armbian.img.xz  
$image

    # Third we use xz to uncompress the image"
    echo "uncompressing the image"
    xz -d -v armbian.img.xz

    # Last we write the image to the emmc module
    echo "Flashing image to /dev/$emmc"
    sudo dd if=armbian.img of=mmcblk1 bs=10M status=noxfer

    # This is to remind to remove the SD Card
    echo "Image has been write to the eMMC storage"
    echo "Please eject the SD Card, before rebooting"

else
     echo "Exiting script, emmc was not touch. Noting writen"
     exit 0

fi

1 thought on “How to flash Armbian to the eMMc of the Banana-Pi BPi-M5”

  1. Hello, I tried to follow your tutorial and I didn’t really understand the part when I download the “armbian” image and the connection you have from your PC to the BPI5 since in another tutorial they point out that a TTL-to-USB can be used, however, You indicated that this was not necessary. If you can explain that part physically since you appear directly in the video connected to the BPI5 by magic, thank you very much in advance

Leave a Reply

Your email address will not be published. Required fields are marked *