Difference between revisions of "Getting Started with R2"

From Banana Pi Wiki
Jump to: navigation, search
(OpenWrt)
(Basic Development)
Line 55: Line 55:
 
   * Execute "git clone https://github.com/garywangcn/bpi-r2_lede.git"
 
   * Execute "git clone https://github.com/garywangcn/bpi-r2_lede.git"
  
   2. You need to have installed gcc, binutils, bzip2, flex, python, perl, make, find, grep, diff, unzip, gawk, getopt, subversion,  
+
   2. You need to have installed gcc, binutils, bzip2, flex, python, perl, make, find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers.
  libz-dev and libc headers.
 
  
   3. Run "./scripts/feeds update -a" to get all the latest package definitions defined in feeds.conf / feeds.conf.default respectively
+
   3. Run "./scripts/feeds update -a" to get all the latest package definitions defined in feeds.conf / feeds.conf.default respectively and "./scripts/feeds install -a" to install symlinks of all of them into package/feeds/.
  and "./scripts/feeds install -a" to install symlinks of all of them into package/feeds/.
 
  
 
   4. Use "make menuconfig" to configure your image.
 
   4. Use "make menuconfig" to configure your image.
Line 74: Line 72:
 
   (2) Write image to TF card, execute "bpi-copy if=mtk-bpi-r2-SD.img of=/dev/sdX"
 
   (2) Write image to TF card, execute "bpi-copy if=mtk-bpi-r2-SD.img of=/dev/sdX"
  
   (3) If you want to install image to EMMC, We need another system which is running on SD card to program EMMC image to EMMC,  
+
   (3) If you want to install image to EMMC, We need another system which is running on SD card to program EMMC image to EMMC, please follow below steps to do:
      please follow below steps to do:
 
 
       * Copy EMMC image to a running system which is from SD card
 
       * Copy EMMC image to a running system which is from SD card
 
       * Program EMMC image to User Data Area of EMMC: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0 (assume /dev/mmcblk0 is for EMMC)
 
       * Program EMMC image to User Data Area of EMMC: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0 (assume /dev/mmcblk0 is for EMMC)
 
       * Unlock EMMC boot0 block: echo 0 > /sys/block/mmcblk0boot0/force_ro
 
       * Unlock EMMC boot0 block: echo 0 > /sys/block/mmcblk0boot0/force_ro
 
       * Program preloader to EMMC boot0 block: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0boot0 bs=1M count=1
 
       * Program preloader to EMMC boot0 block: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0boot0 bs=1M count=1
       * Change the Partition configurion of EMMC is 48h: reboot the system which is running SD, and enter the U-boot command line,  
+
       * Change the Partition configurion of EMMC is 48h: reboot the system which is running SD, and enter the U-boot command line, run command emmc pconf 48 (for this steps, we can change partition configuration in userspace by using mmc-utils,see more information in BPI-R2 OpenWrt(LEDE) Souce code : 2018-04-11)
        run command emmc pconf 48 (for this steps, we can change partition configuration in userspace by using mmc-utils,  
 
        see more information in BPI-R2 OpenWrt(LEDE) Souce code : 2018-04-11)
 
 
       * Power off, remove SD card, and then power on R2 board
 
       * Power off, remove SD card, and then power on R2 board
 
   7. This step is for upgrade, if you don't want to install image after you built, you could use runtime upgrade.
 
   7. This step is for upgrade, if you don't want to install image after you built, you could use runtime upgrade.
   * Copy "bin/targets/mediatek/32/lede-mediatek-32-bananapi,bpi-r2-sysupgrade.tar" to R2 board which is running OpenWrt  
+
   * Copy "bin/targets/mediatek/32/lede-mediatek-32-bananapi,bpi-r2-sysupgrade.tar" to R2 board which is running OpenWrt system(no matter where(SD or EMMC) it boots from), and then run command "sysupgrade lede-mediatek-32-bananapi,bpi-r2-sysupgrade.tar" to update both kernel and rootfs.
    system(no matter where(SD or EMMC) it boots from), and then run command “sysupgrade lede-mediatek-32-bananapi,bpi-r2-sysupgrade.tar”
 
    to update both kernel and rootfs.
 
  
 
==Advanced Development==
 
==Advanced Development==

Revision as of 20:38, 6 May 2018

Introduction

The Banana Pi R2 is a router based development board, which can run on a variety of open source operating systems including OpenWrt, Android, and Bananian. It has 4 Gigabit LAN ports, 1 Gigabit WAN, and 300Mbs wireless N capabilities.

Key Features

  • MediaTek MT7623N, Quad-core ARM Cortex-A7
  • Mali 450 MP4 GPU
  • 2G DDR3 SDRAM
  • Mini PCIE interface
  • SATA interface
  • 4x Gigabit LAN 1x Gigabit WAN

Hardware

R2.jpg

Development

Let's get start to develop on BPI-R2, see amazing things happen.

Basic Development

Prepare to develop

 1.Prepare 16G/above TF card, USB-Serial interface, Ubuntu System
 2.Using your USB-Serial Connect debug console on R2
 R2 debug console.png

Load your first image on R2

 1.You could download latest image from our forum
 * Here is the example image link: http://forum.banana-pi.org/t/bpi-r2-new-image-release-ubuntu-16-04-v1-3-2018-3-30/5293
 2.Install bpi-tools on your Ubuntu
 * apt-get install pv
 * curl -sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash
 
 3.After you download the image, insert your TF card into your Ubuntu
 * Execute "bpi-copy xxx.img /dev/sdx" to install image on your TF card.
 4.After step 3, then you can insert your TF card into R2, and press power button for around 10s to setup R2.

Build your own image on R2

Ubuntu

 1. Clone Bsp project from Github
 * Execute "git clone [email protected]:BPI-SINOVOIP/BPI-R2-bsp.git" 
 2. Execute "./build.sh", to build your own uboot and kernel.
R2 build sh.png
 3. After finish built, Execute "cd SD", plug your Ubuntu TFcard in PC. 
 4. Execute "bpi-update -c bpi-r2.conf -d /dev/sdX", to update the compiled kernel to your TFcard.

OpenWrt

 1. Clone OpenWrt project from Github.
 * Execute "git clone https://github.com/garywangcn/bpi-r2_lede.git"
 2. You need to have installed gcc, binutils, bzip2, flex, python, perl, make, find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers.
 3. Run "./scripts/feeds update -a" to get all the latest package definitions defined in feeds.conf / feeds.conf.default respectively and "./scripts/feeds install -a" to install symlinks of all of them into package/feeds/.
 4. Use "make menuconfig" to configure your image.
 * Choose "Target System" to config as "MediaTek Ralink ARM"
 * Choose "Boot Loaders" to config as "u-boot-bpi_r2"
 5. Execute "make -j1 V=s" to build your own OpenWrt image.
 6. After built, we have two ways to install image.
 (1) Plug your TFcard in Ubuntu PC, and enter to "build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/", 
     you will find two images:
     * mtk-bpi-r2-EMMC.img
     * mtk-bpi-r2-SD.img
 (2) Write image to TF card, execute "bpi-copy if=mtk-bpi-r2-SD.img of=/dev/sdX"
 (3) If you want to install image to EMMC, We need another system which is running on SD card to program EMMC image to EMMC, please follow below steps to do:
     * Copy EMMC image to a running system which is from SD card
     * Program EMMC image to User Data Area of EMMC: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0 (assume /dev/mmcblk0 is for EMMC)
     * Unlock EMMC boot0 block: echo 0 > /sys/block/mmcblk0boot0/force_ro
     * Program preloader to EMMC boot0 block: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0boot0 bs=1M count=1
     * Change the Partition configurion of EMMC is 48h: reboot the system which is running SD, and enter the U-boot command line, run command emmc pconf 48 (for this steps, we can change partition configuration in userspace by using mmc-utils,see more information in BPI-R2 OpenWrt(LEDE) Souce code : 2018-04-11)
     * Power off, remove SD card, and then power on R2 board
 7. This step is for upgrade, if you don't want to install image after you built, you could use runtime upgrade.
 * Copy "bin/targets/mediatek/32/lede-mediatek-32-bananapi,bpi-r2-sysupgrade.tar" to R2 board which is running OpenWrt system(no matter where(SD or EMMC) it boots from), and then run command "sysupgrade lede-mediatek-32-bananapi,bpi-r2-sysupgrade.tar" to update both kernel and rootfs.

Advanced Development

Develop 4G module with R2

Wifi and Ap mode on R2

Make your own image

FAQ

Reference Link

http://www.banana-pi.org/r2.html

http://forum.banana-pi.org/