Banana Pi BPI-R4 路由器板采用 MediaTek MT7988A (Filogic 880) 四核 ARM Corex-A73 设计,4GB DDR4 RAM,8GB eMMC,板载 128MB SPI-NAND 闪存,还有 2x 10Gbe SFP、4x Gbe 网络端口,带 USB3 .2端口,M.2支持4G/5G/NVME SSD。2x miniPCIe插槽,带PCIe3.0 2lane接口,用于Wi-Fi 7 NIC(网络接口卡)。它是一款非常高性能的开源路由器开发板。
更多信息:香蕉派 BPI-R4 |
准备8G以上TF卡、USB转串口线、Ubuntu系统
12V/2A电源适配器(不带任何外设时,BPI-R4主板在最极端的情况下功耗不会超过10W,但需要根据自己的配件使用情况确定是否需要更高功率的电源适配器)
使用 USB 串行电缆(3.3V TTL,波特=115200)连接到 BPI-R4 G=GND 上的调试控制台; RX=BPI-R4输入; TX=BPI-R4 输出0
LAN口默认IP地址:192.168.1.1
用户名/密码:pi/bananapi ,root/bananapi。或者用户是root,没有密码。
WIFI:AP_MTK_MT7990_2G/AP_MTK_MT7990_5G/AP_MTK_MT7990_6G
SW3-A 为“0”,SW3-B 为“1”,BPI-R4 将从 SPI NAND 启动
SW3-A 为“1”,SW3-B 为“0”,BPI-R4 将从 eMMC 启动
如果控制台显示“systemhalt!”,则表示启动存储不包含任何操作系统
F0:102B 0000
传真:5100 0000
传真:5100 0000 [0200]
F9:1041 0000
F3:1001 0000 [0200]
F3:1001 0000
F6:102C 0000
F5:1026 0000
00:1005 0000
传真:5100 0000
传真:5100 0000 [0200]
F9:1041 0000
F3:1001 0000 [0200]
F3:1001 0000
F6:102C 0000
01:102A 0001
02:1005 0000
BP: 0200 00C0 [0001]
欧共体:0000 0000 [0000]
MK: 0000 0000 [0000]
T0:0000 00D7 [0101]
系统死机!
发布图片:https ://wiki.banana-pi.org/Banana_Pi_BPI-R4#Release_image
注意:启动设备选择:https://wiki.banana-pi.org/Getting_Started_with_BPI-R4#Prepare_to_develop
A.注意:在linux电脑上将镜像烧录到SD卡
1.您可以从我们的论坛下载最新的图片
2.在 Ubuntu 上安装 bpi-tools。如果您无法访问此 URL 或出现任何其他问题,请转至 bpi-tools 存储库并手动安装此工具。
apt-get 安装光伏
卷曲-sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash
3.下载镜像后,将TF卡插入Ubuntu
执行“bpi-copy xxx.img /dev/sdx”将镜像安装到TF卡上
4.完成步骤3后,您可以将TF卡插入R4,然后按电源按钮对R4进行设置
B. 注:在 Windows 计算机上将映像刻录到 SD 卡
Balena Etcher 是 Balena 的一款开源 GUI 闪存工具,可将操作系统映像闪存到 SD 卡或 USB 驱动器。
单击“Flash from file”以选择图像。
单击“选择目标”以选择 USB 设备。
点击“闪光!”开始燃烧。
当您想要更新 Nand 设备时,首先将启动开关更改为从 SD 设备启动,并插入一张带有 SD 启动映像的 SD,然后启动后,您需要将一张 nand 映像闪存到 nand 设备中。最后将 bootstrap 更改为从 Nand 设备启动。 |
在将镜像烧录到Nand之前,请准备一个U盘。我们以OpenWrt镜像(mtk-bpi-r4-NAND-20231030.img)为例,步骤如下:
将 Nand 启动 OpenWrt 映像(mtk-bpi-r4-NAND-20231030.img)复制到 U 盘。
更改启动开关跳线,板子从SD设备启动,然后给板子上电。
将U盘插入开发板,并将U盘挂载到/mnt或其他目录,如下:(如果自动挂载则可以跳过挂载)
挂载-t vfat /dev/sda1 /mnt
将目录更改为安装点,这里是: cd /mnt
执行以下命令擦除整个 Nand flash 并将映像复制到 nand 设备:
mtd 擦除 /dev/mtd0
dd if=mtk-bpi-r4-NAND-20231030.img of=/dev/mtdblock0
关闭BPI-R4板的电源,拔掉U盘驱动,将bootstrap更改为从Nand设备启动。
注意:启用Nand设备,引导程序来自Nand。
注意:启动设备选择:https://wiki.banana-pi.org/Getting_Started_with_BPI-R4#Prepare_to_develop
由于SD卡和EMMC设备共用一个SOC的控制器,因此需要切换到NAND启动,然后将EMMC镜像烧录到EMMC中。最后,您将启动更改为从 EMMC 启动。 |
在将镜像烧录到eMMC之前,请准备一个U盘。我们以OpenWrt镜像(bl2_emmc-r4.img、mtk-bpi-r4-EMMC-20231030.img)为例,步骤如下:
将 EMMC 启动 OpenWrt 镜像(bl2_emmc-r4.img、mtk-bpi-r4-EMMC-20231030.img)复制到 U 盘,如果镜像被压缩,请在复制到 U 盘之前解压。
将开关跳线改为Nand,从Nand启动主板。注意:启用Nand设备,引导程序来自Nand
将U盘插入开发板,并将U盘挂载到/mnt或其他目录,如下:(如果自动挂载则可以跳过挂载)
挂载-t vfat /dev/sda1 /mnt
将目录更改为安装点,这里是: cd /mnt
执行 :
回声 0 > /sys/block/mmcblk0boot0/force_ro
dd if=bl2_emmc-r4.img of=/dev/mmcblk0boot0
dd if=mtk-bpi-r4-EMMC-20231030.img of=/dev/mmcblk0
mmc 引导部分启用 1 1 /dev/mmcblk0
关闭R4板电源,删除u盘驱动,将bootstrap更改为从emmc设备启动。
注意:启用 EMMC 设备,引导程序来自 EMMC。
注意:启动设备选择:https://wiki.banana-pi.org/Getting_Started_with_BPI-R4#Prepare_to_develop
BPI-R4的SFP Serdes速度固定为10Gbps,因此只能使用支持此功能的SFP!
通常10G SFP+模块的PIN6为GND。插入模块后,SFP_MOD_DEF0将被拉低,从而打开SFP电源。
因此,如果模块的该PIN不为GND,则不会提供3.3V_SFP电源!
该模块长时间使用时温度很高,在不加散热器或散热风扇的情况下可达90℃。注意防止烫伤!
注意:该模块插入后请勿拔出,否则会导致BPI-R4重启。其他模块不存在此现象。 |
root@R4CN:/# [ 201.763041] mapfilter:drop IP addr timeout! stop dropping IP addr.
[ 499.938345] sfp sfp@0: SM: enter present:up:link_up event los_high
[ 499.950712] mtk_soc_eth 15100000.ethernet eth2: Link is Down
[ 499.956370] sfp sfp@0: SM: exit present:up:wait_los
[ 499.961367] br-wan: port 2(eth2) entered disabled state
[ 502.867442] sfp sfp@0: SM: enter present:up:wait_los event remove
[ 502.873705] sfp sfp@0: module removed
[ 502.877937] sfp sfp@0: tx disable 0 -> 1
[ 502.881872] sfp sfp@0: SM: exit empty:up:down
[ 503.164077] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000180
[ 503.172853] Mem abort info:
[ 503.175634] ESR = 0x96000006
[ 503.178683] EC = 0x25: DABT (current EL), IL = 32 bits
[ 503.183985] SET = 0, FnV = 0
[ 503.187030] EA = 0, S1PTW = 0
[ 503.190162] Data abort info:
[ 503.193035] ISV = 0, ISS = 0x00000006
[ 503.196861] CM = 0, WnR = 0
[ 503.199816] user pgtable: 4k pages, 39-bit VAs, pgdp=000000012fd21000
[ 503.206246] [0000000000000180] pgd=0000000132bfb003, pud=0000000132bfb003, pmd=0000000000000000
[ 503.214936] Internal error: Oops: 96000006 [#1] SMP
[ 503.219799] Modules linked in: ksmbd mt7991(P) mt7990(P) iptable_nat ipt_REJECT xt_time xt_tcpudp xt_state xt_socket xt_recent xt_policy xt_nat xt_multiport xt_mark xt_mac xt_limit xt_iprange xt_helper xt_esp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_TPROXY xt_TCPMSS xt_REDIRECT xt_MASQUERADE xt_LOG xt_FLOWOFFLOAD xt_CT usblp ts_fsm ts_bm spidev rfcomm pptp ppp_mppe nf_tproxy_ipv6 nf_tproxy_ipv4 nf_socket_ipv6 nf_socket_ipv4 nf_reject_ipv4 nf_nat_tftp nf_nat_snmp_basic nf_nat_sip nf_nat_pptp nf_nat_irc nf_nat_h323 nf_nat_amanda nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_conntrack_tftp nf_conntrack_snmp nf_conntrack_sip nf_conntrack_pptp nf_conntrack_netlink nf_conntrack_irc nf_conntrack_h323 nf_conntrack_broadcast ts_kmp nf_conntrack_amanda nf_conncount mtqos mtfwd mapfilter libcrc32c _ppp iptable_raw iptable_mangle iptable_filter ipt_ah ip_tables hidp btusb btintel bnep asn1_decoder mt7990_dbg(P) mtk_wed(P) mtk_pci(P) connac_if(P) mtk_hwifi(P)
[ 503.219869] mt_wifi(P) hid mt_wifi_cmn evdev input_core cfg80211 compat xt_set ip_set_list_set ip_set_hash_netportnet ip_set_hash_netport ip_set_hash_netnet ip_set_hash_netiface ip_set_hash_net ip_set_hash_mac ip_set_hash_ipportnet ip_set_hash_ipportip ip_set_hash_ipport ip_set_hash_ipmark ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac ip_set_bitmap_ip ip_set nfnetlink nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 nfsd ip6_gre ip_gre gre _netlink _core udp_tunnel ip6_udp_tunnel ipcomp6 xfrm6_tunnel esp6 ah6 ip6_tunnel tunnel6 ip_tunnel rpcsec_gss_krb5 auth_rpcgss oid_registry af_key lockd sunrpc grace autofs4 dm_mirror dm_region_hash dm_log dm_crypt nls_utf8 nls_iso8859_1 nls_cp437 macsec seqiv md4 ghash_generic gf128mul gcm cts ctr ccm arc4 mtk_warp mtkhnat leds_gpio xhci_plat_hcd ohci_platform ohci_hcd fsl_mph_dr_of ehci_platform ehci_fsl ehci_hcd gpio_button_hotplug
[ 503.390068] CPU: 2 PID: 7304 Comm: aqr107_mib_thre Tainted: P 5.4.246 #0
[ 503.398227] Hardware name: Bananapi BPI-R4 (DT)
[ 503.402746] pstate: 80000005 (Nzcv daif -PAN -UAO)
[ 503.407531] pc : __phy_read_mmd+0x20/0xa0
[ 503.411529] lr : phy_read_mmd+0x38/0x60
[ 503.415351] sp : ffffffc01388bd90
[ 503.418653] x29: ffffffc01388bd90 x28: 0000000000000000
[ 503.423952] x27: ffffff80f2ae3638 x26: ffffffc010a373c0
[ 503.429250] x25: ffffffc010557918 x24: ffffff80f4ce8800
[ 503.434547] x23: ffffffc010d83908 x22: ffffffc01388be3c
[ 503.439845] x21: 000000000000e811 x20: 0000000000000003
[ 503.445142] x19: ffffff80f4ce8800 x18: ffffffc010c0a1a8
[ 503.450440] x17: 000000000000003c x16: 000000000000003c
[ 503.455738] x15: 0000000000000018 x14: 00000000fffbd1b0
[ 503.461035] x13: 00000000000001f4 x12: ffffffc010c0a160
[ 503.466332] x11: 000000000000c503 x10: 0000000000000830
[ 503.471630] x9 : ffffffc01388bd10 x8 : ffffff80efda0890
[ 503.476927] x7 : ffffffc0eec26000 x6 : ffffffc0eec26000
[ 503.482224] x5 : 0000000000000000 x4 : 0000000000000000
[ 503.487522] x3 : ffffff80f4ce8800 x2 : 000000000000e811
[ 503.492819] x1 : 0000000000000003 x0 : ffffff80f4ce8800
[ 503.498117] Call trace:
[ 503.500553] __phy_read_mmd+0x20/0xa0
[ 503.504202] phy_read_mmd+0x38/0x60
[ 503.507680] aqr107_mib_read_word+0x2c/0x60
[ 503.511850] aqr107_mib_read+0x24/0x200
[ 503.515673] aqr107_mib_thread+0x20/0x50
[ 503.519585] kthread+0x120/0x128
[ 503.522801] ret_from_fork+0x10/0x1c
[ 503.526368] Code: a9be7bfd aa0003e3 910003fd f9418005 (f940c0a5)
[ 503.532447] ---[ end trace 3fa317a53584315f ]---
[ 503.538554] Kernel panic - not syncing: Fatal exception
[ 503.543768] SMP: stopping secondary CPUs
[ 503.547680] Kernel Offset: disabled
[ 503.551155] CPU features: 0x10002,20002008
[ 503.555238] Memory Limit: none
[ 503.559792] Starting Memory dump SMCC
[ 503.563452] Memory dump SMCC failed
[ 503.566929] Rebooting in 3 seconds..
BPI-R4支持4G LTE EC25。移远RM500U-CN和RM520N-GL 5G模块。
如果您想在 BPI-R4 上使用 5G:
将 5G 适配器插入 USB3.0。
将RG200U-CN连接至mini PCIe,通过USB2.0(限速)连接SoC。
制作一块RG200U-CN LGA转接板并将其插入M.2 KEY M。
注:4G/5G 的可用性取决于当地运营商频段。 |
wwan0 Link encap:Ethernet HWaddr A6:35:F7:7A:9E:A7
inet6 addr: fe80::a435:f7ff:fe7a:9ea7/64 Scope:Link
UP RUNNING NOARP MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1272 (1.2 KiB) TX bytes:1932 (1.8 KiB)
wwan0_1 Link encap:Ethernet HWaddr A6:35:F7:7A:9E:A7
inet addr:10.46.121.135 Mask:255.255.255.240
inet6 addr: fe80::a435:f7ff:fe7a:9ea7/64 Scope:Link
UP RUNNING NOARP MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1292 (1.2 KiB) TX bytes:1932 (1.8 KiB)
root@R4CN:/#
root@R4CN:/# lsusb
Bus 002 Device 003: ID 2c7c:0801 Quectel RM520N-GL
Bus 002 Device 002: ID 2109:0822 VIA Labs, Inc. USB3.1 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux 5.4.246 xhci-hcd xHCI Host Controller
Bus 001 Device 003: ID 2109:8822 VIA Labs, Inc. USB Billboard Device
Bus 001 Device 002: ID 2109:2822 VIA Labs, Inc. USB2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux 5.4.246 xhci-hcd xHCI Host Controller
root@R4CN:/#
root@R4CN:/# ping www.baidu.com
PING www.baidu.com (120.232.145.185): 56 data bytes
64 bytes from 120.232.145.185: seq=0 ttl=52 time=30.712 ms
64 bytes from 120.232.145.185: seq=1 ttl=52 time=32.774 ms
64 bytes from 120.232.145.185: seq=2 ttl=52 time=45.222 ms
64 bytes from 120.232.145.185: seq=3 ttl=52 time=37.850 ms
64 bytes from 120.232.145.185: seq=4 ttl=52 time=53.459 ms
^C
--- www.baidu.com ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 30.712/40.003/53.459 ms
root@R4CN:/#
usb0 Link encap:Ethernet HWaddr 5E:3B:9C:76:7C:46
inet addr:10.95.9.23 Bcast:10.95.9.255 Mask:255.255.255.0
inet6 addr: fe80::5c3b:9cff:fe76:7c46/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:34 errors:0 dropped:0 overruns:0 frame:0
TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7908 (7.7 KiB) TX bytes:10100 (9.8 KiB)
root@R4CN:/#
root@R4CN:/# lsusb
Bus 002 Device 003: ID 2c7c:0900 Quectel RM500U-CN
Bus 002 Device 002: ID 2109:0822 VIA Labs, Inc. USB3.1 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux 5.4.246 xhci-hcd xHCI Host Controller
Bus 001 Device 003: ID 2109:8822 VIA Labs, Inc. USB Billboard Device
Bus 001 Device 002: ID 2109:2822 VIA Labs, Inc. USB2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux 5.4.246 xhci-hcd xHCI Host Controller
root@R4CN:/#
root@R4CN:/# ping www.baidu.com
PING www.baidu.com (2409:8c54:870:34e:0:ff:b024:1916): 56 data bytes
64 bytes from 2409:8c54:870:34e:0:ff:b024:1916: seq=0 ttl=51 time=55.105 ms
64 bytes from 2409:8c54:870:34e:0:ff:b024:1916: seq=1 ttl=51 time=38.725 ms
64 bytes from 2409:8c54:870:34e:0:ff:b024:1916: seq=2 ttl=51 time=39.890 ms
^C
--- www.baidu.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 38.725/44.573/55.105 ms
root@R4CN:/#
wwan0 Link encap:Ethernet HWaddr F2:CC:52:10:2E:27
inet addr:10.21.103.116 Bcast:0.0.0.0 Mask:255.255.255.248
inet6 addr: fe80::f0cc:52ff:fe10:2e27/64 Scope:Link
UP BROADCAST RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:91 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7868 (7.6 KiB) TX bytes:10133 (9.8 KiB)
root@R4CN:/#
root@R4CN:/# lsusb
Bus 001 Device 012: ID 2c7c:0125 Quectel Incorporated LTE Module
Bus 002 Device 002: ID 2109:0822 VIA Labs, Inc. USB3.1 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux 5.4.246 xhci-hcd xHCI Host Controller
Bus 001 Device 003: ID 2109:8822 VIA Labs, Inc. USB Billboard Device
Bus 001 Device 002: ID 2109:2822 VIA Labs, Inc. USB2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux 5.4.246 xhci-hcd xHCI Host Controller
root@R4CN:/#
root@R4CN:/# ping www.baidu.com
PING www.baidu.com (120.232.145.144): 56 data bytes
64 bytes from 120.232.145.144: seq=0 ttl=53 time=47.085 ms
64 bytes from 120.232.145.144: seq=1 ttl=53 time=36.447 ms
^C
--- www.baidu.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 36.447/41.766/47.085 ms
root@R4CN:/#
理论上也支持PCIe蜂窝模块,但尚未测试
BPI-R4支持JMicron的JMB585(PCIe转5x SATA芯片)
root@R4CN:/# lspci
0002:00:00.0 PCI bridge: MEDIATEK Corp. Device 7988 (rev 01)
0002:01:00.0 SATA controller: JMicron Technology Corp. JMB58x AHCI SATA controller
0004:00:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7981
root@R4CN:/#
root@R4CN:/# [ 743.794932] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 743.802031] ata1.00: HPA detected: current 234439535, native 234441648
[ 743.808746] ata1.00: ATA-8: Hitachi HTS542512K9SA00, BB2OC31P, max UDMA/133
[ 743.815699] ata1.00: 234439535 sectors, multi 0: LBA48 NCQ (depth 32), AA
[ 743.823749] ata1.00: configured for UDMA/133
[ 743.828182] scsi 0:0:0:0: Direct-Access ATA Hitachi HTS54251 C31P PQ: 0 ANSI: 5
[ 743.836710] sd 0:0:0:0: [sda] 234439535 512-byte logical blocks: (120 GB/112 GiB)
[ 743.844204] sd 0:0:0:0: [sda] Write Protect is off
[ 743.848992] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 743.854075] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 744.221268] sda: sda1 sda2
[ 744.224485] sd 0:0:0:0: [sda] Attached SCSI disk
[ 744.459896] EXT4-fs (sda1): The kernel was not built with CONFIG_QUOTA and CONFIG_QFMT_V2
root@R4CN:/#
root@R4CN:/#
root@R4CN:/# cat /proc/partitions
major minor #blocks name
31 0 131072 mtdblock0
31 1 1024 mtdblock1
31 2 512 mtdblock2
31 3 4096 mtdblock3
31 4 2048 mtdblock4
31 5 115200 mtdblock5
179 0 7634944 mmcblk0
253 0 56172 ubiblock0_1
8 0 117219767 sda
8 1 8388608 sda1
8 2 2097152 sda2
root@R4CN:/#
您可以将BPI-R4-NIC插入BPI-R4-Main底部的CN12和CN14,然后用两颗M2螺钉固定。
BPI-R4-NIC 模块需要 12V 电源,因此上电前必须先打开 BPI-R4-Main 上的电源(SW4 拨至“ON”位置,上电时 12V LED 会亮起)在)
12V 电源将通过 miniPCI 插座的 PIN6/8/48 提供给 BPI-R4-NIC。插接其他模块时,如果无法确认模块是否能承受12V,请务必关闭SW4。 |
root@OpenWrt:/# lspci
0000:00:00.0 PCI bridge: MEDIATEK Corp. Device 7988 (rev 01)
0000:01:00.0 Network controller: MEDIATEK Corp. Device 7990
0001:00:00.0 PCI bridge: MEDIATEK Corp. Device 7988 (rev 01)
0001:01:00.0 Network controller: MEDIATEK Corp. Device 7991
0004:00:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7981