Banana Pi R2 Pro Firmware Install

Flashing the Banana Pi R2 Pro - EMMC Installation

Caption

The Banana Pi R2 Pro is a powerful smart router development board that comes with gigabit network, an M.2 key-E and mini PCIe interface, 2 MIPI DSI interfaces (one can change to LVDS by software), 1 CSI camera interface, 1 HDMI output, and a SATA port. It's an ideal choice for those looking to create network device solutions tailored to their specific needs.

Although the Banana Pi hardware offers great value for money and has readily available firmware that's regularly updated, their documentation can be challenging to follow, especially for someone new to IoT devices and Linux. In this post, we'll explain how to flash the firmware onto the onboard EMMC module of the R2 Pro.

 

Banana Pi R2 Pro Image Selection

 

There are several images available to flash on the R2 Pro, including Ubuntu 22.04, Android 12, and OpenWrt. However, some images may not enable all hardware features. For example, the OpenWrt image doesn't enable HDMI, so you'll be left staring at a blank screen wondering if the installation worked. Make sure to use the latest images available on the Banana Pi R2 Pro wiki.

In addition, although links to the images can be found on the Banana Pi Wiki they may link to older images. There have been cases in the past where images are broken too, so if you don't succeed in flashing a particular image try another. By the time you read this, the images would have been updated but the official place for image links is the Banana Pi R2 Pro wiki.

The images we commonly use are:

  • Linux - Ubuntu 22.04 - Boots to GUI
  • Android - Android 12 - Boots to GUI
  • OpenWrt- Web interface and ssh access
OpenWRT has no HDMI out

 

Flashing the Image to the R2 Pro with Linux & Maskrom Mode

 

There are two ways to flash the image according to the Banana Pi wiki.

  • Via USB Download
  • Via SD card installation

In this post, we'll describe the installation process using USB installation via Maskrom mode, a special operation mode for the CPU to wait for the USB OTG port command. Banana Pi provides a customized tool to flash the image to the device once it's in Maskrom mode. We'll explain how to do this in Linux. In Windows, you can use GUI tools to flash the device rather than the command line. The steps to get the R2 Pro into Maskrom mode and how to complete the installation after the initial installation onto the EMMC are the same so this post should be helpful even if you not using Linux. (You really should you know)

 

Steps to flash EMMC Module on R2 Pro

 

  1. Preparing the R2 Pro for installation
  2. Download an image to deploy
  3. Put R2 Pro into maskrom mode
  4. Start the image deploy application
  5. Reboot R2 Pro
  6. Enjoy

 

1 Preparing the R2 Pro for installation

 

We are going to use the maskrom mode method to deploy to the emmc module. This means we need to:

  1. Plug a male-to-male USB connector from the first/top USB port on the R2 Pro into your PC.
  2. Attach the HDMI output to a monitor. Note that it will display a BPI logo initially, then some information about updating "user data" as you install in later steps. In the case of the Linux/Android image, it will update on reboot and show a GUI. For OpenWrt, it will always show the Banana Pi logo "BPI."
  3. Optionally attach a TTL to USB serial connector. It allows you to see the output of the deployment and reboot process. It's invaluable if you have issues and want to troubleshoot. The documentation says you can use a micro-USB connector to view the serial output too. We couldn't get this to work, so your mileage may vary if you want to try and don't have a TTL to USB converter on hand.
  4. Plug in the power adapter. The wiki implies that the USB connection can supply power and that it is necessary to unplug the power at certain points in the installation process. We found this was not the case.

 

2 Download an Image to deploy

 

Download an image from the wiki.   We will be using the SDCard image so download the file with  "SDBoot" in its name. Unzip it.  It should contain a file called "update.img". This file seems to be a single binary containing all the images required to install the operating system. The file with "EMMCBoot" in its name is an exploded version of this file, as far as I can tell. I couldn't find out how to deploy the "EMMCBoot" image with Linux but one can with Windows using yet another GUI tool. Make sure you have the "update.img" file in a path you can find for deployment.

Tip: In Linux, it is best to use the command line to unzip "unzip <filename>". I have found the GUI unzip option has resulted in a corrupted image in the past.

 

3 Put the R2 Pro in Maskrom Mode

 

First, download the Linux USB tool. Then as per the wiki.

 $ unzip Linux_Upgrade_Tool_xxxx.zip
 $ cd Linux_UpgradeTool_xxxx
 $ sudo mv upgrade_tool /usr/local/bin
 $ sudo chown root:root /usr/local/bin/upgrade_tool
 $ sudo chmod a+x /usr/local/bin/upgrade_tool

To put the R2 Pro into Maskrom mode hold down the "maskroom" button and push the reset button. (Note the misspelling of maskrom)  Release the reset button and then release the "maskroom" button. If. from the PC you are deploying form, you do a

"tail -f /var/log/syslog"

you should see a new USB device being discovered when you release the "maskroom" button. Alternatively, run "upgrade_tool ld" (ld = list devices). It should detect the Rockchip USB device. If it says "No devices found" then you need to redo the steps to set the R2 Pro into maskrom mode. If it lists the Rockchip USB device you are good to go.

 

4 Start the image deploy application

 

Now that you have the R2 Pro in maskrom mode and downloaded the image you can deploy to the EMMC module. This step is Linux specific. For Windows please use the tool as per the Banana Pi wiki.  To begin the download execute:

upgrade_tool uf <path_to/update.img>

This will download the image to the EMMC module. 

upgrade_tool will exit with the error "Download Firmware Fail"

You can ignore this error as the image has been successfully deployed.

 

5 Reboot the R2 Pro

 

You now need to reboot the R2 Pro. If you have had the serial output running you will see that you have been dumped to the command line or, in the case of the OpenWRT image, you will see the network has been successfully initialised and you will not have access to the cli. You can reboot at this point. If you don't have access to the serial output reboot once the "upgrade_tool" app has exited. It's simplest to do this with the reset button.

When you have the serial console output you can see it booting.  Otherwise you just have to wait for it to reboot and initialise. It will take a minute or two but not longer than 10 minutes to come up.

In the case of the Linux image you will eventually get a GUI login. The username password is pi/banana pi. For the Android image you will have access to the Android GUI. For the OpenWRT image you will have no GUI access via the HDMI output. You will need to open a web browser and access the IP address of the network port you have plugged into the R2 Pro or use ssh. The default username/password is "root/123456" 

If you don't know the IP address assigned to the R2 Pro then run

nmap -sn <ip network address/24>

Examine the output to determine the assigned IP address. (You may need to install nmap with "sudo apt get install nmap". I my network I had to run "namp -sn 10.0.0.0/24".

 

5 Enjoy

 

Congratulations. You have installed the image to the Banan Pi R2 Pro. If it hasn't worked for you check the following:

  • The USB Rockchip devices has been detected by your OS. See Maskrom mode.
  • The image is valid and not corrupted. Check the MD5Sum. Also remember the OpenWRT image has no HDMI output. Use SSH to connect.
  • Don't stress if update_tool exits with an error. It is probably a red-herring and you good to reboot.
  • Use a TTL to USB converter to check the serial console output for error.

Blogs