[BPi-R3-Mini] Review and mainline ImmortalWrt firmware support

Oh sorry, I had it wrong. pls ignore my reply

that might be why I can’t get a link in U-BOOT. I’m connecting to a 1gbe nic and nothing happens until i boot into openwrt

wan-port (right one)

BPI-R3M> setenv ipaddr 192.168.90.2
BPI-R3M> ping 192.168.90.1
ethernet@15100000 Waiting for PHY auto negotiation to complete......... TIMEOUT!
ret -110!
ping failed; host 192.168.90.1 is not alive
BPI-R3M>

lan (left port including bootup):

U-Boot 2024.01-bpi-r3mini-00008-g9448f7a5c567-dirty (Jan 17 2024 - 22:57:09 +01)

CPU:   MediaTek MT7986
Model: Bananapi BPi-R3 Mini
DRAM:  2 GiB
Core:  44 devices, 19 uclasses, devicetree: separate
MMC:   mmc@11230000: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial@11002000
Out:   serial@11002000
Err:   serial@11002000
Net:   PHY = 3a2 - a411
EN8811H PHY ready!
EN8811H Mode 1 !
Tx, Rx Polarity(0xca0f8): 01a01501
MD32 FW Version(0x3b3c) : 23051209
LED initialize OK !
EN8811H initialize OK ! (v1.0.4)

Warning: ethernet@15100000 (eth0) using random MAC address - 22:f9:43:af:15:7c
eth0: ethernet@15100000
Hit any key to stop autoboot:  0 
BPI-       
BPI-R3M> setenv ipaddr 192.168.90.2
BPI-R3M> ping 192.168.90.1         
Using ethernet@15100000 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.90.1 is not alive
BPI-R3M>

link on other side is up (with 2500/fdx) when using lan-port…not when using wan-port, netmask=255.255.255.0, and the other side has also /24 set. so ip configuration is right.

ARP Retry count exceeded; starting again

This issue might be related to using a fake (random) mac address. Try to set ethaddr to the original mac address

My guess is that the wrong phy (both are powered,but only one is connected) is connected to ethernet mac…but of course i can try setting mac address. Strange is that @1715173329 reports he connected wan port,but i see “better” state on lan. Too bad that the schematics does not show the connection between phy and mac. I try to find it out with vendors openwrt image. There it works. But i should start new thread to not pollute this one…

In both cases, using either the official or immortalwrt uboot, recommend to use tcpdump to validate whats happening on wire, also you can capture the real mac address.

Edit: Yes. you are right. phy14(LAN) is the port which is closed to the USB-C connector. may be he reported by mistake.

Is that on u-boot or linux?

Edit: Yes. you are right. phy14(LAN) is the port which is closed to the USB-C connector. may be he reported by mistake.

Thanks for mentioning this. It didn’t even occur to me to test the “LAN” port as the immortalWRT instructions said to connect to the “WAN” port. Will try this later.



I confirmed on the stock image that the RM500U-CNV is indeed working and is getting an IP from my provider without any additional configuration like setting the APN etc. Funny enough the RM500U-CNV doesn’t have “usbnet”,0 . It has 1,3,5,11,13. The Module started working on “usbnet”,3 (which I forgot I set when I was testing the 5G Module on the immortalWRT image)

First I try your changes you made to your .dts (GPIO and Voltage settings). If this doesn’t work I’ll take a look at the code in the sinovoip repo. They seem to have additional binaries in the folder sbin which loads the official quectel-CM and quectel-qmi-proxy. And they have a .patch for the RM500 & RM520 which is almost 3000 lines long.

https://github.com/BPI-SINOVOIP/BPI-R3MINI-OPENWRT-V21.02.3/tree/main/target/linux/mediatek/mt7986/base-files/sbin 

My uboot…not done much with linux yet as i want to get tftp working in uboot first. But in my linux network was also not working,but i need to start a new thread for it

@nezar_taima so it works for you with lan-port…maybe i miss a config option. Have you installed a nvme (i do some tests with it too,but not yet recognized)?

For nvme, NO, but actually tried to connect AW7916-NPD through mpcie-to-m2 adapter, unfortunately it was not detected.

hello guys, I recently ported wwan support to immortalwrt, it supports qmi and mbim mode for now.
luci-proto-quectel is used for dialing, luci-app-3ginfo-lite for query module info, and luci-app-modemband for band locking.

see: GitHub - immortalwrt/wwan-packages: Applications for WWAN support

also fixed 2 bugs on bpi r3-mini: power on the wwan module, and (hopefully) r/w issue on spi-nand

Very cool! Any chance this will get into the official OpenWrt?

thank you! I just cloned the new repo from your master branch. when I “make menuconfig” I can’t find wwan-packages.

Can you tell me how to add wwan-packages to the build?

@ everyone: I was playing around with the quectel-cm binaries from sinovoips repo and its a blessing as it’s automatically configuring the quectel modem and setting a default route. I’m struggling setting up passthrough mode on the quectel since i want to use the r3mini as a glorified modem and my mikrotik router will handle the rest. so far mikrotik is not getting the passed through IP from the modem. Seems i need to find the correct AT+ command to set the modem to passthrough mode

Here you go

AT+QMAP="MPDN_rule",0,1,0,3,1,"mikrotik hostname"
AT+QMAP="IPPT_NAT",0

thank you for the commands! unfortunately AT+QMAP doesn’t seem to be working on the RM500U-CNV. Kind of annoying that i can’t find a documentation for it.

OK
AT+QMAP=?
+CME ERROR: 4

AT+QCFG=?
+QCFG: "usbnet",(1,3,5,11,13,15)
+QCFG: "nat",(0-2)
+QCFG: "usbcfg",(1-65535),(1-65535),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1)
+QCFG: "ims",(0,1)
+QCFG: "pcie/mode",(0,1)
+QCFG: "ethernet",(0,1)
+QCFG: "uartat",(0,1)
+QCFG: "usbid",(1-65535),(1-65535)
+QCFG: "multiusbnet",(1-4),(0-4)
+QCFG: "usbmac",(sipa_usb0,usb0,usb1,usb2,usb3)
+QCFG: "hostmac",(usb0,usb1,usb2,usb3),<mac>
+QCFG: "staticarp",(0,usb0,usb1,usb2,usb3),<mac>
+QCFG: "lanip",<gateway>,<netmask>,<lease_time>
+QCFG: "lanip_ex",<lease_time>
+QCFG: "loopback",(0-15)
+QCFG: "usage/apmem"
+QCFG: "usage/apfs"
+QCFG: "proxyarp",(0,1)
+QCFG: "5glan",(1-8),(0,1)
+QCFG: "vlan",(0,1)
+QCFG: "autoapn",(0,1)
+QCFG: "usbmode",(host,device,auto)
+QCFG: "usbreset"
+QCFG: "usbspeed",(11,20,30,auto)
+QCFG: "rp_filter",(0-2)
+QCFG: "ipa",(0-2)
+QCFG: "netmask",(0,1)
+QCFG: "thermal/modem",(1,2),(0~110000)
+QCFG: "tts",(0,1)
+QCFG: "pm/powersave",(0,1,2,3)
+QCFG: "vonr",(0,1)
+QCFG: "pcie/direct",(0,1)
+QCFG: "pack",(0,1)
+QCFG: "mtu",(1-4),<mtu>
+QCFG: "eth_at",(0,1)
+QCFG: "iq_vser",(0,1)
+QCFG: "clat",(0,1)
+QCFG: "quecdumptime",(0~5000000)
+QCFG: "ip6/cfg","neigh"

Very good packages, works as expected. thanks

This board is supported by official OpenWrt now, thanks @dangowrt (also sorry for that as I missed it).

Thank you for having done all the preparations for the R3 mini, that made things much easier.

You didn’t, it push it to main tree only shortly before you wrote this post :wink:

1 Like

Hi Daniel

First of all, let me thank you to support R3 mini by official openwrt. I’ve flashed the image to emmc, but the board stuck in boot loop below are the logs (any advice)

[   18.378880] mtk_soc_eth 15100000.ethernet eth0: validation of 2500base-x with support 00000000,00000000,000062e8 and advertisement 00000000,00000000,000062c0 failed: -EINVAL
[   18.394874] leds mdio-bus:0e:green:lan: Setting an LED's brightness failed (-524)
[   18.402724] leds mdio-bus:0e:yellow:lan: Setting an LED's brightness failed (-524)
[   18.410556] Unable to handle kernel write to read-only memory at virtual address ffffffc0080a8c40
[   18.419419] Mem abort info:
[   18.422203]   ESR = 0x000000009600004f
[   18.425938]   EC = 0x25: DABT (current EL), IL = 32 bits
[   18.431235]   SET = 0, FnV = 0
[   18.434276]   EA = 0, S1PTW = 0
[   18.437404]   FSC = 0x0f: level 3 permission fault
[   18.442177] Data abort info:
[   18.445041]   ISV = 0, ISS = 0x0000004f
[   18.448860]   CM = 0, WnR = 1
[   18.451811] swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000044a8e000
[   18.458491] [ffffffc0080a8c40] pgd=10000000bffff003, p4d=10000000bffff003, pud=10000000bffff003, pmd=10000000bfffe003, pte=00500000440a8783
[   18.470988] Internal error: Oops: 000000009600004f [#1] SMP
[   18.476542] Modules linked in: pppoe ppp_async option nft_fib_inet nf_flow_table_inet usb_wwan pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mt7915e mt76_connac_lib mt76 mac80211 cfg80211 cdc_mbim usbserial slhc qmi_wwan nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c compat cdc_ncm cdc_ether crypto_safexcel qmi_wwan_f qmi_wwan_q usbnet cdc_wdm configs pwm_fan sha1_generic seqiv md5 des_generic libdes authencesn authenc leds_gpio xhci_plat_hcd xhci_pci xhci_mtk_hcd xhci_hcd gpio_button_hotplug usbcore usb_common mii
[   18.546439] CPU: 0 PID: 2115 Comm: netifd Not tainted 6.1.77 #0
[   18.552341] Hardware name: Bananapi BPi-R3 Mini (DT)
[   18.557287] pstate: a04000c5 (NzCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   18.564226] pc : detach_if_pending+0x1c/0xa0
[   18.568489] lr : del_timer_sync+0x58/0x90
[   18.572482] sp : ffffffc00b2db9a0
[   18.575779] x29: ffffffc00b2db9a0 x28: ffffff800b9e8900 x27: 0000000000000000
[   18.582896] x26: 0000007ff89162a8 x25: 0000000000001003 x24: ffffffc0088aa630
[   18.590012] x23: 0000000000000080 x22: ffffff80009dc080 x21: ffffff80009dc418
[   18.597127] x20: 0000000000000000 x19: ffffff80000c4d20 x18: 0000000000000002
[   18.604242] x17: 2064656c69616620 x16: 7373656e74686769 x15: 75622d6f69646d2f
[   18.611358] x14: 0000000000000004 x13: ffffff8000025410 x12: 0000000000000000
[   18.618474] x11: ffffff8000461f90 x10: ffffff8000461da8 x9 : ffffff8000025410
[   18.625590] x8 : ffffff807fb84a40 x7 : 0000000000000000 x6 : ffffff800045d6b0
[   18.632706] x5 : 0000000000000000 x4 : ffffffc0080a8c40 x3 : ffffff80000c4d20
[   18.639821] x2 : 0000000000000001 x1 : ffffff807fb84a40 x0 : 0000000000000124
[   18.646937] Call trace:
[   18.649369]  detach_if_pending+0x1c/0xa0
[   18.653278]  led_stop_software_blink+0x18/0x44
[   18.657706]  led_classdev_unregister+0x5c/0xf0
[   18.662132]  phy_remove+0x38/0x90
[   18.665435]  device_remove+0x68/0x7c
[   18.668996]  device_release_driver_internal+0x1d4/0x240
[   18.674203]  device_release_driver+0x14/0x20
[   18.678456]  phy_detach+0xc4/0x15c
[   18.681844]  phylink_fwnode_phy_connect+0xe4/0x100
[   18.686617]  phylink_of_phy_connect+0x18/0x20
[   18.690958]  mtk_open+0x34/0xa10
[   18.694171]  __dev_open+0xf0/0x164
[   18.697560]  __dev_change_flags+0x138/0x190
[   18.701727]  dev_change_flags+0x20/0x60
[   18.705546]  dev_ifsioc+0x434/0x454
[   18.709022]  dev_ioctl+0x144/0x4d0
[   18.712408]  sock_ioctl+0x1ac/0x430
[   18.715884]  __arm64_sys_ioctl+0x4b8/0xedc
[   18.719967]  invoke_syscall.constprop.0+0x4c/0xe0
[   18.724655]  do_el0_svc+0x40/0xd0
[   18.727955]  el0_svc+0x14/0x4c
[   18.730999]  el0t_64_sync_handler+0xec/0x120
[   18.735253]  el0t_64_sync+0x14c/0x150
[   18.738902] Code: b4000460 a9401060 b9402065 b4000140 (f9000080)
[   18.744975] ---[ end trace 0000000000000000 ]---
[   18.752767] Kernel panic - not syncing: Oops: Fatal exception
[   18.758495] SMP: stopping secondary CPUs
[   18.762402] Kernel Offset: disabled
[   18.765873] CPU features: 0x00000,00000004,0000400b
[   18.770733] Memory Limit: none
[   18.776845] Rebooting in 3 seconds..

F0: 102B 0000
FA: 1040 0000
FA: 1040 0000 [0200]
F9: 103F 0000
F3: 1006 0033 [0200]
F3: 4001 00E0 [0200]
F3: 0000 0000
V0: 0000 0000 [0001]
00: 0000 0000
BP: 2400 0041 [0000]
G0: 1190 0000
EC: 0000 0000 [2000]
T0: 0000 021F [010F]
Jump to BL

NOTICE:  BL2: v2.9.0(release):OpenWrt v2023-10-13-0ea67d76-1 (mt7986-emmc-ddr4)
NOTICE:  BL2: Built : 13:56:01, Feb 16 2024
NOTICE:  WDT: [40000000] Software reset (reboot)
NOTICE:  WDT: disabled
NOTICE:  CPU: MT7986 (2000MHz)
NOTICE:  EMI: Using DDR4 settings
NOTICE:  EMI: Detected DRAM size: 2048MB
NOTICE:  EMI: complex R/W mem test passed
NOTICE:  BL2: Booting BL31
NOTICE:  BL31: v2.9.0(release):OpenWrt v2023-10-13-0ea67d76-1 (mt7986-emmc-ddr4)
NOTICE:  BL31: Built : 13:56:01, Feb 16 2024


U-Boot 2024.01-OpenWrt-r25215-1323314087 (Feb 16 2024 - 13:56:01 +0000)

CPU:   MediaTek MT7986
Model: Bananapi BPi-R3 Mini
DRAM:  2 GiB
Core:  53 devices, 23 uclasses, devicetree: embed
spi-nand: spi_nand spi_nand@0: Winbond SPI NAND was found.
spi-nand: spi_nand spi_nand@0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
MMC:   mmc@11230000: 0
Loading Environment from MMC... OK
In:    serial@11002000
Out:   serial@11002000
Err:   serial@11002000
reset button found
Loading Environment from MMC... OK
Net:   eth0: ethernet@15100000
Cannot read EFI system partition
Cannot read EFI system partition
Failed to persist EFI variables

      ( ( ( OpenWrt ) ) )  [eMMC]       U-Boot 2024.01-OpenWrt-r25215-1323314087 (Feb 16 2024 - 13:56:01 +0000)

    1. Run default boot command.
    2. Boot system via TFTP.
    3. Boot production system from eMMC.
    4. Boot recovery system from eMMC.
    5. Load production system via TFTP then write to eMMC.
    6. Load recovery system via TFTP then write to eMMC.
    7. Load Airoha EN8811H firmware via TFTP then write to eMMC.
    8. Load BL31+U-Boot FIP via TFTP then write to eMMC.
    9. Load BL2 preloader via TFTP then write to eMMC.
    a. Reboot.
    b. Reset all settings to factory defaults.

This looks like you built the image without the needed PHY driver kmod-phy-airoha-en8811h. The kernel surely also shouldn’t crash when setting up the LEDs only because the PHY driver is missing, but in order to have Ethernet you will anyway need it.

When starting a new empty .config and selecting the BPi-R3-mini board this package should also get selected automatically. Did it not?