banana pi BPI-R2 open source smart router
  • About banana pi BPI-R2
  • BPI-R2 hardware
    • BPI-R2 hardware interface
    • BPI-R2 hardware spec
    • BPI-R2 GPIO Pin define
    • BPI-R2 SATA interface
    • BPI-R2 micro SD card slot
    • BPI-R2 5 GigE port
    • BPI-R2 eMMC flash
    • BPI-R2 WIFI interface
    • BPI-R2 wifi antenna slot
    • BPI-R2 bluetooth interface
    • BPI-R2 MIPI DSI interface
    • BPI-R2 HDMI interface
    • BPI-R2 USB 3.0 interface
    • BPI-R2 Uart interface
    • BPI-R2 PCIE interface
    • BPI-R2 OTG interface
    • BPI-R2 Power interface
    • BPI-R2 schematic diagram
    • BPI-R2 DXF and 3D design
  • BPI-R2 software
    • BPI-R2 quick start
    • Linux image,kernel 4.4
    • Android image
    • OpenWRT/LEDE
    • BPI-7615(based on MT7615)
  • BPI-R2 source code on github
    • BPI-R2 BSP source code
    • OpenWRT source code
    • BPI-R2 LEDE source code for hardware NAT
    • Frank`s github for BPI-R2
  • Reference documents
    • FW-Web Wiki
  • BPI-R1 BPI-R2 board Comparison
  • BPI-R2 quality guarantee
  • All banana pi product
  • BPI 4.0 customized Server
  • Getting Started with R2 - Banana Pi Wiki
  • en:bpi-r2:start [FW-WEB -Wiki]
Powered by GitBook
On this page

Was this helpful?

  1. BPI-R2 source code on github

BPI-R2 LEDE source code for hardware NAT

PreviousOpenWRT source codeNextFrank`s github for BPI-R2

Last updated 5 years ago

Was this helpful?

BPI-R2 LEDE source code for hardware NAT

Source code

The source code is at:

Please clone the code to local and checkout the code from branch **bpi-r2-on-lede-v1**.

Build

Follow the LEDE building instruction to compile the lede system, the target system is MediaTek Ralink ARM, the config file is attached.

Image

Please download the image I built from below link

Boot with LEDE image

Step 1: Please program LEDE 2017-09-08 image to emmc by following

Step 2: Boot the board from EMMC, and enter U-boot shell.

Step 3: Load build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/uImage-mt7623n-bananapi-bpi-r2-initramfs from host pc(tftp 84000000 uImage-mt7623n-bananapi-bpi-r2-initramfs). Before loading image, you may need to set/ipaddr/netmask/serverip in uboot

Step 4: Program the image to EMMC by run command:

> mmc dev 0

> mmc write 84000000 1000 5800

discuss on forum:

Configurion of LEDE

TARGET=MediaTek Ralink ARM Boot Loaders=u-boot-bpi_r2 (This option is mandatory)

How to build make -j1 V=s

Images when above steps is done, we will below two images under <TOP>/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/:

mtk-bpi-r2-EMMC.img

mtk-bpi-r2-SD.img

How to use SD image A SD card is requried and then install mtk-bpi-r2-SD.img to SD card by running below command:

  dd if=mtk-bpi-r2-SD.img  of=/dev/sdb

where /dev/sdb is the SD card.

And then install the SD card to R2 board, power it on, the board will boot from SD card.

How to use EMMC image We need another system which is running on SD card to program EMMC image to EMMC, please follow below steps to do:

  1. Copy EMMC image to a running system which is on SD card

  2. Program EMMC image to User Data Area of EMMC: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0

  3. Unlock EMMC boot0 block: echo 0 > /sys/block/mmcblk0boot0/force_ro

  4. Program preloader to EMMC boot0 block: dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk0boot0 bs=1M count=1

  5. 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

  6. Power off, remove SD card, and then power on R2 board.

LEDE source code(Please note that the branch is bpi-r2-on-lede-v1)

https://github.com/garywangcn/bpi-r2_lede
http://pan.baidu.com/s/1nuXqAVJ
http://forum.banana-pi.org/t/bpi-r2-new-image-openwrt-lede-2017-09-08/3797/19
http://forum.banana-pi.org/t/bpi-r2-lede-source-code-for-hardware-nat/3940
https://github.com/garywangcn/bpi-r2_lede/tree/bpi-r2-on-lede-v1