Difference between revisions of "Getting Started with BPI-R3 MINI"

From Banana Pi Wiki
Jump to: navigation, search
(Prepare to develop)
(4G/5G Module)
 
(106 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
==Introduction==
 
==Introduction==
  
Banana Pi BPI-R3 Mini Router board with MediaTek MT7986(Filogic 830) quad core ARM A53 chip design ,2G DDR RAM ,8G eMMC flash onboard,It is a very high performance open source router development board,support Wi-Fi6 2.4G wifi use MT7976 and 5G wifi use MT7976, support 2 2.5GbE network port.
+
Banana Pi BPI-R3 Mini Router board with MediaTek MT7986A(Filogic 830) quad core ARM A53 chip design ,2G DDR RAM ,8G eMMC flash onboard,It is a very high performance open source router development board,support Wi-Fi6 2.4G/5G with MT7976C, support 2x 2.5GbE ethernet port.
  
 
==MediaTek MT7986(Filogic 830)==
 
==MediaTek MT7986(Filogic 830)==
Line 12: Line 12:
 
==Key Features==
 
==Key Features==
  
* MediaTek MT7986(Filogic 830) Quad core ARM Cortex A53
+
* MediaTek MT7986A(Filogic 830) Quad core ARM Cortex A53
 
* Wifi 6 2.4G/5G(MT7976C)
 
* Wifi 6 2.4G/5G(MT7976C)
 
* 2G DDR RAM
 
* 2G DDR RAM
 
* 8G eMMC flash
 
* 8G eMMC flash
 
* 128MB Nand flash
 
* 128MB Nand flash
* 2x 2.5GbE network port
+
* 2x 2.5GbE Ethernet port
 
* 1x M.2 Key B USB inerface
 
* 1x M.2 Key B USB inerface
 
* 1x M.2 KEY M PCIe inerface
 
* 1x M.2 KEY M PCIe inerface
Line 27: Line 27:
 
   * Prepare USB-Serial interface
 
   * Prepare USB-Serial interface
 
   * Using your USB-Serial Connect debug console on BPI-R3 MINI
 
   * Using your USB-Serial Connect debug console on BPI-R3 MINI
   Note: Debug Uart 3.3v TTL
+
   Note: '''Debug Uart 3.3v TTL,Baud: 115200'''.
 +
  * Default IP address for LAN port: '''192.168.1.1'''
 +
  * User name/password: '''pi/bananapi''' ,'''root/bananapi'''.
 +
  Or the user is '''root without a password'''.
 +
  * WIFI: '''Operwrt'''
 
   
 
   
 
   [[Image:BPI-R3-MINI-Back.png|320px]]
 
   [[Image:BPI-R3-MINI-Back.png|320px]]
  
   *R3 boot switch Jumper Setting
+
   *R3mini boot switch Jumper Setting
 
   Note: EMMC Boot or Nand boot Support.
 
   Note: EMMC Boot or Nand boot Support.
  
===How to burn image to SD card===
+
=== Warnning ===
   A. Note: burn image to SD card on linux computer
+
  Note: Because BPI-R3 MINI can't support that it boot from SD, So the factory will flash one default image into Nand and EMMC Device.
    1.You could download latest image from our forum
+
  Anytime please confirm that one EMMC or Nand device include one bootable image, it's very important!!
    * Here is the example image link:
+
 
 +
  If there is no OS in the memory, the consol port will print "System halt!" and sotp running.
 +
  At this time, you need to switch to another memory to boot from.
 +
  [[File:SYSHalt.png]]
 +
 
 +
  if you want to update EMMC device, please boot from Nand
 +
  [[File:R3mini NANDBOOT2.png]]
 +
 
 +
  otherwise you update Nand device when it boot from EMMC.
 +
  [[File:R3mini eMMCBOOT.png]]
 +
 
 +
   
 +
====How to burn image to onboard eMMC====
 +
   Note: when you want to Update EMMC device, Firstly Change boot switch to boot from Nand device, then after boot up,you need flash one emmc image into EMMC device. Finally you change bootstrap to boot from EMMC.
 +
 
 +
  Before burning image to eMMC, please prepare a USB disk. Let's take OpenWrt image (mtk-bpi-r3mini-EMMC-20230719.img, bl2_emmc-r3mini.img) for example, the steps are below:
 +
 
 +
  1. Copy EMMC boot OpenWrt image(mtk-bpi-r3mini-EMMC-20230719.img, bl2_emmc.img) to USB disk.
 
    
 
    
    2.Install bpi-tools on your Ubuntu. If you can't access this URL or any other problems, please go to [https://github.com/BPI-SINOVOIP/bpi-tools bpi-tools repo] and install this tools manually.
+
  2. Change boot switch Jumper, the board boot from Nand device, then power up the board.
    * 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
+
  3. Plug in USB disk to the board, and mount the USB to /mnt or other directory as follows: (you can skip mounting if it is mounted automatically)
    * Execute "bpi-copy xxx.img /dev/sdx" to install image on your TF card
+
    * mount -t vfat /dev/sda1 /mnt
 
+
    * change your directory to the mounting point, here is : cd /mnt
    4.After step 3, then you can insert your TF card into R3, and press power button to setup R3
 
  B. Note: burn image to SD card on windows computer
 
    1. Download the tools from the website:  https://sourceforge.net/projects/win32diskimager/
 
    2. Install the tools into Windows computer.
 
    3. flash image into SD card.
 
 
 
C. Change Boot Jumper to boot from SD, Enable SD Card Device.
 
    [[Image:BPI-R3-Jumper-ALL-High.png|320px]]
 
  
====How to burn image to onboard eMMC====
+
  4. Execute following command to enable and copy image to EMMC device:
  Note: because SD card and EMMC device share one SOC's interface, you need flash one SD image firstly, then R3 boot from SD card, then flash nand image into Nand, then change boot strap to boot from nand,  you need flash EMMC image into EMMC. Finally you change bootstrap to boot from EMMC.
+
    * echo 0 > /sys/block/mmcblk0boot0/force_ro
 +
    * dd if=bl2_emmc-r3mini.img of=/dev/mmcblk0boot0
 +
    * dd if=mtk-bpi-r3mini-EMMC-20230719.img of=/dev/mmcblk0
 +
    * mmc bootpart enable 1 1 /dev/mmcblk0
  
   Before burning image to eMMC, please prepare a SD card with flashed bootable image and a USB disk. Let's take OpenWrt image (mtk-bpi-r3-SD-WAN1-SFP1-20220619-single-image.img, mtk-bpi-r3-NAND-WAN1-SFP1-20220619-single-image.bin, bl2_emmc.img, mtk-bpi-r3-EMMC-WAN1-SFP1-20220619-single-image.img) for example, the steps are below:
+
   5. power off R3MINI board, remove u-disk driver, change bootstrap to boot from emmc device.
 +
    Note: Enable EMMC device, boot strap is from EMMC.
  
   1. Insert the flashed SD card and power on to start the board.(the image "mtk-bpi-r3-SD-WAN1-SFP1-20220619-single-image.img" on the SD card can be OpenWrt or other linux OS like ubuntu...)
+
====How to burn image to onboard Nand====
 +
   Note: when you want to Update Nand device, Firstly Change boot switch to boot from EMMC device, then after boot up,you need flash one nand image into nand device. Finally you change bootstrap to boot from Nand device.
  
   2. Copy Nand bootable and EMMC boot OpenWrt image(mtk-bpi-r3-NAND-WAN1-SFP1-20220619-single-image.bin, bl2_emmc.img, mtk-bpi-r3-EMMC-WAN1-SFP1-20220619-single-image.img) to USB disk, if the image is compressed please uncompress it before copying to USB disk.
+
   Before burning image into Nand, please prepare a USB disk. Let's take OpenWrt image (mtk-bpi-r3mini-NAND-20230719-single-image.bin) for example, the steps are below:
  
 +
  1. Copy Nand boot OpenWrt image(mtk-bpi-r3mini-NAND-20230719-single-image.bin) to USB disk.
 +
 
 +
  2. Change boot switch Jumper, the board boot from EMMC device, then power up the board.
 +
 
 
   3. Plug in USB disk to the board, and mount the USB to /mnt or other directory as follows: (you can skip mounting if it is mounted automatically)
 
   3. Plug in USB disk to the board, and mount the USB to /mnt or other directory as follows: (you can skip mounting if it is mounted automatically)
 
     * mount -t vfat /dev/sda1 /mnt  
 
     * mount -t vfat /dev/sda1 /mnt  
 
     * change your directory to the mounting point, here is : cd /mnt
 
     * change your directory to the mounting point, here is : cd /mnt
  
   4. Execute following command to enable and copy image to nand flash:
+
   4. Execute following command to erase the whole Nand flash and copy image to nand device:
 
     * mtd erase /dev/mtd0
 
     * mtd erase /dev/mtd0
     * dd if=mtk-bpi-r3-NAND-WAN1-SFP1-20220619-single-image.bin of=/dev/mtdblock0
+
     * dd if=mtk-bpi-r3mini-NAND-20230719-single-image.bin of=/dev/mtdblock0
 
 
  5. Shutdown, remove SD card, and change bootstrap to boot from nand flash and change SD/EMMC switch jumper to EMMC, restart the board from Nand Flash.
 
    Note: Enable EMMC device, boot strap is from nand
 
    [[Image:BPI-R3-Jumper-Flash-EMMC.png|320px]]
 
 
 
  6. repeat step 3, mount u-disk to /mnt, Execute following command to enable and copy image to EMMC device:
 
    * mount -t vfat /dev/sda1 /mnt
 
    * echo 0 > /sys/block/mmcblk0boot0/force_ro
 
    * dd if=bl2_emmc.img of=/dev/mmcblk0boot0
 
    * dd if=mtk-bpi-r3-EMMC-WAN1-SFP1-20220619-single-image.img of=/dev/mmcblk0
 
    * mmc bootpart enable 1 1 /dev/mmcblk0
 
  
   7. power off R3 board, remove u-disk driver, change bootstrap to boot from emmc device.
+
   5. power off BPI-R3 MINI board, remove u-disk driver, change bootstrap to boot from Nand device.
     Note: Enable EMMC device, boot strap is from EMMC.
+
     Note: Enable Nand device, boot strap is from Nand.
    [[Image:BPI-R3-Jumper-Boot-EMMC.png|320px]]
 
  
 
=== Network-Configuration===
 
=== Network-Configuration===
 
*Network-Configuration refer to: http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:network:start
 
*Network-Configuration refer to: http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:network:start
*Network Interface: eth1, lan0 is for WAN; lan4, rax0, lan2, lan5, ra0, lan3, lan1 is for LAN,  ra0 is for 2.4G wireless, rax0 is for 5G wireless.
+
*Network Interface: eth1 is for WAN; eth0, rax0, ra0 is for LAN,  ra0 is for 2.4G wireless, rax0 is for 5G wireless.
  
[[Image:BPI-R3_network_interface.jpg|640px]]
+
[[File:BPI-R3_MINI_interface.jpg|640px]]
  
 
root@OpenWrt:/# ifconfig
 
root@OpenWrt:/# ifconfig
Line 129: Line 137:
 
           RX bytes:0 (0.0 B)  TX bytes:8674 (8.4 KiB)
 
           RX bytes:0 (0.0 B)  TX bytes:8674 (8.4 KiB)
 
           Interrupt:124
 
           Interrupt:124
 
lan0      Link encap:Ethernet  HWaddr EE:A1:57:81:CA:19
 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
 
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 
          collisions:0 txqueuelen:1000
 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
 
lan1      Link encap:Ethernet  HWaddr EE:A1:57:81:CA:19
 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
 
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 
          collisions:0 txqueuelen:1000
 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
 
lan2      Link encap:Ethernet  HWaddr EE:A1:57:81:CA:19
 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
 
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 
          collisions:0 txqueuelen:1000
 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
 
lan3      Link encap:Ethernet  HWaddr EE:A1:57:81:CA:19
 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
 
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 
          collisions:0 txqueuelen:1000
 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
 
lan4      Link encap:Ethernet  HWaddr EE:A1:57:81:CA:19
 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
 
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 
          collisions:0 txqueuelen:1000
 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
 
lan5      Link encap:Ethernet  HWaddr EE:A1:57:81:CA:19
 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
 
          collisions:0 txqueuelen:1000
 
          RX bytes:0 (0.0 B)  TX bytes:2418 (2.3 KiB)
 
  
 
lo        Link encap:Local Loopback
 
lo        Link encap:Local Loopback
Line 199: Line 165:
  
 
bridge name    bridge id              STP enabled    interfaces
 
bridge name    bridge id              STP enabled    interfaces
br-wan          7fff.eea15781ca19      no              lan0, eth1
+
br-wan          7fff.eea15781ca19      no              eth1
  
 
root@OpenWrt:/# brctl show br-lan
 
root@OpenWrt:/# brctl show br-lan
  
 
bridge name    bridge id              STP enabled    interfaces
 
bridge name    bridge id              STP enabled    interfaces
br-lan          7fff.eea15781ca19      no              lan4, rax0, lan2, lan5, ra0, lan3, lan1
+
br-lan          7fff.eea15781ca19      no              eth0, rax0, ra0, apclix0, apcli0
  
 
root@OpenWrt:/#
 
root@OpenWrt:/#
 +
 +
 +
===iperf3  test===
 +
 +
[[File:R3mini-case-wanlanA.png]]
 +
 +
 +
2.5G Ethernet:
 +
 +
R3miniA(WAN)---|            |
 +
                |2.5G switch |---Ethernet   
 +
R3miniB(WAN)---|            |
 +
R3miniA <-------iperf3------> R3miniB
 +
[[File:R3mini-iperf3-WAN.png]]
 +
 +
 +
 +
                    R3miniA(WAN)---|            |
 +
                                    |2.5G switch |---Ethernet     
 +
R3miniC(WAN)---(LAN)R3miniB(WAN)---|            |
 +
R3miniC <-------iperf3------> R3miniA     
 +
  [[File:R3mini-iperf3-Switch.png]]
 +
 +
 +
5GWi-Fi:
 +
 +
iPhone 5Gwifi <-------iperf3------> (Wi-Fi) BPI-R3mini
 +
Note: The distance between iPhone and R3mini is about one meter.
 +
[[File:R3mini-WiFiTestA.png]]
  
 
==Advanced Development==
 
==Advanced Development==
===GPIO===
 
====26 Pins Definition====
 
 
[[Image:R3_gpio_40.jpg]]
 
  
 
====GPIO Control====
 
====GPIO Control====
Line 231: Line 222:
 
===FAN===
 
===FAN===
  
[[Image:FAN.png]]
+
[[Image:R3mini-FAN-CON.png]]
  
* R317 for 5V FAN and R318 for 12V FAN.
+
* CN16 is a 1.25 pitch 3PIN socket, used to connect the fan, supports PWM control.
* CN23 supports PWM control while CN22 does not support.
 
  
 
====PWM FAN Control====
 
====PWM FAN Control====
Line 243: Line 233:
 
* echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
 
* echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
  
===miniPCIe slot===
+
===M.2 KEY B slot===
currently, miniPCIe slot only support one USB 4G module, example: EC25
+
currently, M.2 KEY B slot only support USB 4G/5G module, example: Quectel RM500U-CN or RM520N-GL
when you insert one EC25 module, you may check it.
+
 
 +
when you install one 4G/5G module, you may check it.
 +
 
 +
[[File:R3mini-RM500U-1000.png]]
  
[[Image:BPI-R3-miniPCIe-Slot-EC25.jpg]]
+
=== 4G/5G Module===
 +
BPI-R3mini supports '''M.2 KEYB USB interface''' Cellular network module: 4G LTE EM05, 5G Quectel RM500U-CN/RG200U-CN and RM520N-GL/RM500Q-GL Series.
  
===SFP===
+
The released image(2023-11-15 or later) default driver is RM500U-CN and RM520N-GL, Install one of these two modules and you can use it directly.
After high and low temperature test, the following modules are suppoted by BPI-R3:
 
  
[[Image:SFP.png]]
+
If use EM05 or others,you will most likely need to modify the driver.
 +
 
 +
::1. Install 4G/5G Cellular Module into CN4 Slot(M.2 KEYB)
 +
::2. Inset the NANOSIM Card
 +
::3. Install antenna on the module
 +
::4. After powering on, it will automatically dial
  
===4G&5G===
 
* BPI-R3 supports 4G LTE EC25.
 
* If you want to use 5G on BPI-R3:
 
    1. Insert 5G dongle into USB3.0.
 
    2. Connect RG200U-CN to mini PCIe, connect SoC through USB2.0(speed limited).
 
    3. Make an RG200U-CN LGA adapter board and insert it into M.2 KEY M.
 
 
Note: The availability of 4G/5G depends on the local carrier frequency band.
 
Note: The availability of 4G/5G depends on the local carrier frequency band.
  
===Ap mode on BPI-R3===
+
[[File:BPI-R3_mini_cellular.jpg]]
 +
 
 +
  '''RM520N-GL'''
 +
  wwan0    Link encap:Ethernet  HWaddr C2:CA:76:42:83:EC
 +
            NOARP  MTU:1500  Metric:1
 +
            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 +
            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 +
            collisions:0 txqueuelen:1000
 +
            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 +
 
 +
  wwan0_1  Link encap:Ethernet  HWaddr C2:CA:76:42:83:EC
 +
            NOARP  MTU:1500  Metric:1
 +
            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 +
            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 +
            collisions:0 txqueuelen:1000
 +
            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 +
 
 +
  root@OpenWrt:/#
 +
  root@OpenWrt:/# lsusb
 +
  Bus 001 Device 001: ID 1d6b:0002 Linux 5.4.188 xhci-hcd xHCI Host Controller
 +
  Bus 002 Device 002: ID 2c7c:0801 Quectel RM520N-GL
 +
  Bus 002 Device 001: ID 1d6b:0003 Linux 5.4.188 xhci-hcd xHCI Host Controller
 +
  root@OpenWrt:/#
 +
  root@OpenWrt:/# ping baidu .com
 +
  PING baidu.com (110.242.68.66) 56 data bvtes
 +
  64 bytes from 110.242.68.66: seq=0 ttl=50 time=38.540 ms
 +
  64 bytes from 110.242.68.66: seq=1 ttl=50 time=38.276 ms
 +
  64 bytes from 110.242.68.66: seq=2 ttl=50 time=38.355 ms
 +
  64 bytes from 110.242.68.66: seq=3 ttl=50 time=38.788 ms
 +
  ^C
 +
  --- baidu.com ping statistics ---
 +
  4 packets transmitted, 4 received,0% packet loss
 +
  round-trip min/avg/max = 38.276/38.490/38.788 ms
 +
  root@OpenWrt:/#
 +
 
 +
  '''RM500U-CN'''
 +
  usb0      Link encap:Ethernet  HWaddr 46:F7:1B:36:AE:26
 +
            inet addr:10.101.26.65  Bcast:10.101.26.255  Mask:255.255.255.0
 +
            inet6 addr: 2409:895a:30a9:55e2:44f7:1bff:fe36:ae26/64 Scope:Global
 +
            inet6 addr: fe80::5c3b:9cff:fe76:7c46/64 Scope:Link
 +
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 +
            RX packets:191 errors:0 dropped:2 overruns:0 frame:0
 +
            TX packets:243 errors:0 dropped:0 overruns:0 carrier:0
 +
            collisions:0 txqueuelen:1000
 +
            RX bytes:71800 (70.1 KiB)  TX bytes:35923 (35.0 KiB)
 +
  root@R3mini-Router:/#
 +
  root@R3mini-Router:/# lsusb
 +
  Bus 001 Device 001: ID 1d6b:0002 Linux 5.4.171 xhci-hcd xHCI Host Controller
 +
  Bus 002 Device 002: ID 2c7c:0900 RM500U-CN
 +
  Bus 002 Device 001: ID 1d6b:0003 Linux 5.4.171 xhci-hcd xHCI Host Controller
 +
  root@R3mini-Router:/#
 +
 
 +
===Wi-Fi Ap mode on BPI-R3mini===
  
 
* ra0  is MT7986a 2.4G wifi
 
* ra0  is MT7986a 2.4G wifi
 
* rax0 is MT7986a 5G wifi
 
* rax0 is MT7986a 5G wifi
  
===Wifi & Serial cable===
+
===Serial cable===
* '''If the chip type of serial cable is pl2303, the driver fails to load the firmware apparently and thus the wifi can't work.'''
+
Because the UART0_TXD of the debug port is also a wifi strap pin, this pin needs to be pull-low when poweron,
* '''Other types including cp2102,ch340 and FDTI are all available, serial cable vlotage must be 3.3v LVTTL standard.
+
 
'''
+
some serial cable have strong pull-up, such as PL2303,if it is inserted before powering on, it will cause the wifi chip to be recognized incorrectly, and the wifi function will fail.
'''UART_TX0 is the Boot Strapping PIN and must be kept low during power-on.'''
+
 
 +
Other types including cp2102,ch340 and FDTI are all available, serial cable power domian  must be 3.3v TTL standard.
 +
 
 +
You can buy the serial cable here: https://www.aliexpress.us/item/3256805457599756.html?
 +
 
 +
 
 +
[[File:R3mini-USBC2UART.png]]
 +
 
 +
If your computer has a USB TypeC connector and supports PD12V/1.5A (20W) or above, you can also directly use the computer to power BPI-R3mini.
 +
 
 +
Moreover, since BPI-R3mini has built-in USB to serial port chip CH340E, you do not need to use additional serial cables.
 +
 
 +
'''NOTE:If your computer does not support USB PD, then the R3mini will most likely keep restarting.'''  
  
[[File:Strapping.png|720px]]
+
Because the power consumption of R3mini is relatively large (all peripherals are plugged in and the power consumption is close to 20W when running)
  
 
==FAQ==
 
==FAQ==
Line 279: Line 335:
 
::Google Drive:https://drive.google.com/file/d/1biSJmxnIpNzQroYDg9mtPtSTAv4i0DFf/view?usp=sharing
 
::Google Drive:https://drive.google.com/file/d/1biSJmxnIpNzQroYDg9mtPtSTAv4i0DFf/view?usp=sharing
 
===TTL Voltage===
 
===TTL Voltage===
:: The debug-uart TTL is tolerant to 3.3V.
+
:: The debug uart is 3.3V TTL power domain.
  
 
='''Reference Link'''=
 
='''Reference Link'''=
  
 
http://forum.banana-pi.org/
 
http://forum.banana-pi.org/

Latest revision as of 17:27, 1 February 2024

Introduction

Banana Pi BPI-R3 Mini Router board with MediaTek MT7986A(Filogic 830) quad core ARM A53 chip design ,2G DDR RAM ,8G eMMC flash onboard,It is a very high performance open source router development board,support Wi-Fi6 2.4G/5G with MT7976C, support 2x 2.5GbE ethernet port.

MediaTek MT7986(Filogic 830)

The MT7986(Filogic 830) integrates four Arm Cortex-A53 cores up to 2GHz with up to 18,000 DMIPs of processing power and 6Gbps of dual 4x4 Wi-Fi6 connectivity. It has two 2.5g Ethernet interfaces and serial peripheral interfaces (SPI). Filogic 830‘s built-in hardware acceleration engine enables fast and reliable Wi-Fi offloading and wireless network connection. In addition, the chip supports Mediatek FastPath™ technology, which is suitable for games, AR/VR and other low-latency applications.

Wi-fi 6 has many advantages over its predecessors, including lower latency, larger bandwidth capacity and faster transmission rates. Wireless network devices supporting the 6GHz band mainly use 160MHz wide channel and 6GHz uncongested bandwidth to provide multigigabit transmission and low-latency wi-fi connection, providing reliable wireless network for streaming media, games, AR/VR and other applications.

Key Features

  • MediaTek MT7986A(Filogic 830) Quad core ARM Cortex A53
  • Wifi 6 2.4G/5G(MT7976C)
  • 2G DDR RAM
  • 8G eMMC flash
  • 128MB Nand flash
  • 2x 2.5GbE Ethernet port
  • 1x M.2 Key B USB inerface
  • 1x M.2 KEY M PCIe inerface
  • 1x USB2.0 interface

Development

Basic Development

Prepare to develop

 * Prepare USB-Serial interface
 * Using your USB-Serial Connect debug console on BPI-R3 MINI
  Note: Debug Uart 3.3v TTL,Baud: 115200.
 * Default IP address for LAN port: 192.168.1.1
 * User name/password: pi/bananapi ,root/bananapi.
 Or the user is root without a password.
 * WIFI: Operwrt

 BPI-R3-MINI-Back.png
 *R3mini boot switch Jumper Setting
  Note: EMMC Boot or Nand boot Support.

Warnning

 Note: Because BPI-R3 MINI can't support that it boot from SD, So the factory will flash one default image into Nand and EMMC Device. 
 Anytime please confirm that one EMMC or Nand device include one bootable image, it's very important!!
 If there is no OS in the memory, the consol port will print "System halt!" and sotp running.
 At this time, you need to switch to another memory to boot from.
 SYSHalt.png
 if you want to update EMMC device, please boot from Nand
 R3mini NANDBOOT2.png
 otherwise you update Nand device when it boot from EMMC.
 R3mini eMMCBOOT.png


How to burn image to onboard eMMC

 Note: when you want to Update EMMC device, Firstly Change boot switch to boot from Nand device, then after boot up,you need flash one emmc image into EMMC device. Finally you change bootstrap to boot from EMMC.
 Before burning image to eMMC, please prepare a USB disk. Let's take OpenWrt image (mtk-bpi-r3mini-EMMC-20230719.img, bl2_emmc-r3mini.img) for example, the steps are below:
 1. Copy EMMC boot OpenWrt image(mtk-bpi-r3mini-EMMC-20230719.img, bl2_emmc.img) to USB disk.
 
 2. Change boot switch Jumper, the board boot from Nand device, then power up the board.
 
 3. Plug in USB disk to the board, and mount the USB to /mnt or other directory as follows: (you can skip mounting if it is mounted automatically)
    * mount -t vfat /dev/sda1 /mnt 
    * change your directory to the mounting point, here is : cd /mnt
 4. Execute following command to enable and copy image to EMMC device:
    * echo 0 > /sys/block/mmcblk0boot0/force_ro
    * dd if=bl2_emmc-r3mini.img of=/dev/mmcblk0boot0
    * dd if=mtk-bpi-r3mini-EMMC-20230719.img of=/dev/mmcblk0
    * mmc bootpart enable 1 1 /dev/mmcblk0
 5. power off R3MINI board, remove u-disk driver, change bootstrap to boot from emmc device.
    Note: Enable EMMC device, boot strap is from EMMC.

How to burn image to onboard Nand

 Note: when you want to Update Nand device, Firstly Change boot switch to boot from EMMC device, then after boot up,you need flash one nand image into nand device. Finally you change bootstrap to boot from Nand device.
 Before burning image into Nand, please prepare a USB disk. Let's take OpenWrt image (mtk-bpi-r3mini-NAND-20230719-single-image.bin) for example, the steps are below:
 1. Copy Nand boot OpenWrt image(mtk-bpi-r3mini-NAND-20230719-single-image.bin) to USB disk.
 
 2. Change boot switch Jumper, the board boot from EMMC device, then power up the board.
 
 3. Plug in USB disk to the board, and mount the USB to /mnt or other directory as follows: (you can skip mounting if it is mounted automatically)
    * mount -t vfat /dev/sda1 /mnt 
    * change your directory to the mounting point, here is : cd /mnt
 4. Execute following command to erase the whole Nand flash and copy image to nand device:
    * mtd erase /dev/mtd0
    * dd if=mtk-bpi-r3mini-NAND-20230719-single-image.bin of=/dev/mtdblock0
 5. power off BPI-R3 MINI board, remove u-disk driver, change bootstrap to boot from Nand device.
    Note: Enable Nand device, boot strap is from Nand.

Network-Configuration

BPI-R3 MINI interface.jpg

root@OpenWrt:/# ifconfig

br-lan Link encap:Ethernet HWaddr EE:A1:57:81:CA:19

         inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
         inet6 addr: fe80::eca1:57ff:fe81:ca19/64 Scope:Link
         inet6 addr: fd63:8bea:d5ce::1/60 Scope:Global
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:0 (0.0 B)  TX bytes:2418 (2.3 KiB)

br-wan Link encap:Ethernet HWaddr EE:A1:57:81:CA:19

         inet6 addr: fe80::eca1:57ff:fe81:ca19/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:0 (0.0 B)  TX bytes:8538 (8.3 KiB)

eth0 Link encap:Ethernet HWaddr EE:A1:57:81:CA:19

         inet6 addr: fe80::eca1:57ff:fe81:ca19/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:0 (0.0 B)  TX bytes:4408 (4.3 KiB)
         Interrupt:124

eth1 Link encap:Ethernet HWaddr 4A:BB:84:B4:5D:3F

         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:0 (0.0 B)  TX bytes:8674 (8.4 KiB)
         Interrupt:124

lo Link encap:Local Loopback

         inet addr:127.0.0.1  Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING  MTU:65536  Metric:1
         RX packets:56 errors:0 dropped:0 overruns:0 frame:0
         TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:4368 (4.2 KiB)  TX bytes:4368 (4.2 KiB)

ra0 Link encap:Ethernet HWaddr 00:0C:43:26:60:38

         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
         Interrupt:6

rax0 Link encap:Ethernet HWaddr 02:0C:43:36:60:38

         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@OpenWrt:/# brctl show br-wan

bridge name bridge id STP enabled interfaces br-wan 7fff.eea15781ca19 no eth1

root@OpenWrt:/# brctl show br-lan

bridge name bridge id STP enabled interfaces br-lan 7fff.eea15781ca19 no eth0, rax0, ra0, apclix0, apcli0

root@OpenWrt:/#


iperf3 test

R3mini-case-wanlanA.png


2.5G Ethernet:

R3miniA(WAN)---|            |
               |2.5G switch |---Ethernet     
R3miniB(WAN)---|            |
R3miniA <-------iperf3------> R3miniB
R3mini-iperf3-WAN.png


                    R3miniA(WAN)---|            |
                                   |2.5G switch |---Ethernet      
R3miniC(WAN)---(LAN)R3miniB(WAN)---|            |
R3miniC <-------iperf3------> R3miniA       
 R3mini-iperf3-Switch.png


5GWi-Fi:

iPhone 5Gwifi <-------iperf3------> (Wi-Fi) BPI-R3mini
Note: The distance between iPhone and R3mini is about one meter.
R3mini-WiFiTestA.png

Advanced Development

GPIO Control

  • echo xxx > /sys/class/gpio/export
  • echo in/out > /sys/class/gpio/gpioxxx/direction
  • echo 0/1 > /sys/class/gpio/gpioxxx/value

Check the base gpio, you could see mine is 411

BPI-R3-GPIO-Base.jpg

For example: if you want to change gpio 22 as out highlevel, you need input commands like this:

  • echo 433(22+411) > /sys/class/gpio/export
  • echo out > /sys/class/gpio/gpio433/direction
  • echo 1 > /sys/class/gpio/gpio433/value

FAN

R3mini-FAN-CON.png

  • CN16 is a 1.25 pitch 3PIN socket, used to connect the fan, supports PWM control.

PWM FAN Control

  • echo 0 > /sys/class/pwm/pwmchip0/export
  • echo 10000 > /sys/class/pwm/pwmchip0/pwm0/period
  • echo 5000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
  • echo normal > /sys/class/pwm/pwmchip0/pwm0/polarity
  • echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable

M.2 KEY B slot

currently, M.2 KEY B slot only support USB 4G/5G module, example: Quectel RM500U-CN or RM520N-GL

when you install one 4G/5G module, you may check it.

R3mini-RM500U-1000.png

4G/5G Module

BPI-R3mini supports M.2 KEYB USB interface Cellular network module: 4G LTE EM05, 5G Quectel RM500U-CN/RG200U-CN and RM520N-GL/RM500Q-GL Series.

The released image(2023-11-15 or later) default driver is RM500U-CN and RM520N-GL, Install one of these two modules and you can use it directly.

If use EM05 or others,you will most likely need to modify the driver.

1. Install 4G/5G Cellular Module into CN4 Slot(M.2 KEYB)
2. Inset the NANOSIM Card
3. Install antenna on the module
4. After powering on, it will automatically dial

Note: The availability of 4G/5G depends on the local carrier frequency band.

BPI-R3 mini cellular.jpg

 RM520N-GL
 wwan0     Link encap:Ethernet  HWaddr C2:CA:76:42:83:EC
           NOARP  MTU:1500  Metric:1
           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
 wwan0_1   Link encap:Ethernet  HWaddr C2:CA:76:42:83:EC
           NOARP  MTU:1500  Metric:1
           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
 root@OpenWrt:/#
 root@OpenWrt:/# lsusb
 Bus 001 Device 001: ID 1d6b:0002 Linux 5.4.188 xhci-hcd xHCI Host Controller
 Bus 002 Device 002: ID 2c7c:0801 Quectel RM520N-GL
 Bus 002 Device 001: ID 1d6b:0003 Linux 5.4.188 xhci-hcd xHCI Host Controller
 root@OpenWrt:/#
 root@OpenWrt:/# ping baidu .com
 PING baidu.com (110.242.68.66) 56 data bvtes
 64 bytes from 110.242.68.66: seq=0 ttl=50 time=38.540 ms
 64 bytes from 110.242.68.66: seq=1 ttl=50 time=38.276 ms
 64 bytes from 110.242.68.66: seq=2 ttl=50 time=38.355 ms
 64 bytes from 110.242.68.66: seq=3 ttl=50 time=38.788 ms
 ^C
 --- baidu.com ping statistics ---
 4 packets transmitted, 4 received,0% packet loss
 round-trip min/avg/max = 38.276/38.490/38.788 ms
 root@OpenWrt:/#
 RM500U-CN
 usb0      Link encap:Ethernet  HWaddr 46:F7:1B:36:AE:26
           inet addr:10.101.26.65  Bcast:10.101.26.255  Mask:255.255.255.0
           inet6 addr: 2409:895a:30a9:55e2:44f7:1bff:fe36:ae26/64 Scope:Global
           inet6 addr: fe80::5c3b:9cff:fe76:7c46/64 Scope:Link
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:191 errors:0 dropped:2 overruns:0 frame:0
           TX packets:243 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000 
           RX bytes:71800 (70.1 KiB)  TX bytes:35923 (35.0 KiB)
 root@R3mini-Router:/# 
 root@R3mini-Router:/# lsusb
 Bus 001 Device 001: ID 1d6b:0002 Linux 5.4.171 xhci-hcd xHCI Host Controller
 Bus 002 Device 002: ID 2c7c:0900 RM500U-CN
 Bus 002 Device 001: ID 1d6b:0003 Linux 5.4.171 xhci-hcd xHCI Host Controller
 root@R3mini-Router:/#

Wi-Fi Ap mode on BPI-R3mini

  • ra0 is MT7986a 2.4G wifi
  • rax0 is MT7986a 5G wifi

Serial cable

Because the UART0_TXD of the debug port is also a wifi strap pin, this pin needs to be pull-low when poweron,

some serial cable have strong pull-up, such as PL2303,if it is inserted before powering on, it will cause the wifi chip to be recognized incorrectly, and the wifi function will fail.

Other types including cp2102,ch340 and FDTI are all available, serial cable power domian must be 3.3v TTL standard.

You can buy the serial cable here: https://www.aliexpress.us/item/3256805457599756.html?


R3mini-USBC2UART.png

If your computer has a USB TypeC connector and supports PD12V/1.5A (20W) or above, you can also directly use the computer to power BPI-R3mini.

Moreover, since BPI-R3mini has built-in USB to serial port chip CH340E, you do not need to use additional serial cables.

NOTE:If your computer does not support USB PD, then the R3mini will most likely keep restarting.

Because the power consumption of R3mini is relatively large (all peripherals are plugged in and the power consumption is close to 20W when running)

FAQ

  • MT7986a Reference Manual for Develope Board(BPi)
Google Drive:https://drive.google.com/file/d/1biSJmxnIpNzQroYDg9mtPtSTAv4i0DFf/view?usp=sharing

TTL Voltage

The debug uart is 3.3V TTL power domain.

Reference Link

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