OpenWrt Support for Banana Pi BPI-R3

Installation to eMMC works by initially booting from the micro SD card (and hence using the sdcard image), then installing to SPI-NAND. When booting from SPI-NAND you can then install to eMMC. This is because microSD and eMMC cannot be accessed at the same time.

See also https://openwrt.org/toh/sinovoip/bananapi_bpi-r3#installation

1 Like

Hello,
since i migrated today to OpenWrt 24.10, my SFP transceiver on SFP2 is disconnecting/reconnecting in loop. sometimes it works for 15 minutes and then starts up again disconnecting.

Sat Feb 15 11:32:20 2025 kern.info kernel: [  548.365462] mt7530-mdio mdio-bus:1f sfp2: Link is Down
Sat Feb 15 11:32:20 2025 kern.info kernel: [  548.365551] br-lan: port 5(sfp2) entered disabled state
Sat Feb 15 11:32:20 2025 daemon.notice netifd: Network device 'sfp2' link is down
Sat Feb 15 11:32:33 2025 kern.info kernel: [  561.870503] mt7530-mdio mdio-bus:1f sfp2: Link is Up - 2.5Gbps/Full - flow control off
Sat Feb 15 11:32:33 2025 kern.info kernel: [  561.870699] br-lan: port 5(sfp2) entered blocking state
Sat Feb 15 11:32:33 2025 daemon.notice netifd: Network device 'sfp2' link is up
Sat Feb 15 11:32:33 2025 kern.info kernel: [  561.883632] br-lan: port 5(sfp2) entered forwarding state
Sat Feb 15 11:32:35 2025 kern.info kernel: [  563.948316] mt7530-mdio mdio-bus:1f sfp2: Link is Down
Sat Feb 15 11:32:35 2025 kern.info kernel: [  563.948404] br-lan: port 5(sfp2) entered disabled state
Sat Feb 15 11:32:35 2025 daemon.notice netifd: Network device 'sfp2' link is down
Sat Feb 15 11:32:39 2025 kern.info kernel: [  568.104162] mt7530-mdio mdio-bus:1f sfp2: Link is Up - 2.5Gbps/Full - flow control off
Sat Feb 15 11:32:39 2025 kern.info kernel: [  568.104357] br-lan: port 5(sfp2) entered blocking state
Sat Feb 15 11:32:39 2025 daemon.notice netifd: Network device 'sfp2' link is up
Sat Feb 15 11:32:39 2025 kern.info kernel: [  568.117294] br-lan: port 5(sfp2) entered forwarding state
Sat Feb 15 11:32:41 2025 kern.info kernel: [  569.143056] mt7530-mdio mdio-bus:1f sfp2: Link is Down
Sat Feb 15 11:32:41 2025 kern.info kernel: [  569.143145] br-lan: port 5(sfp2) entered disabled state
Sat Feb 15 11:32:41 2025 daemon.notice netifd: Network device 'sfp2' link is down
Sat Feb 15 11:32:45 2025 kern.info kernel: [  573.299007] mt7530-mdio mdio-bus:1f sfp2: Link is Up - 2.5Gbps/Full - flow control off
Sat Feb 15 11:32:45 2025 kern.info kernel: [  573.299200] br-lan: port 5(sfp2) entered blocking state
Sat Feb 15 11:32:45 2025 daemon.notice netifd: Network device 'sfp2' link is up
Sat Feb 15 11:32:45 2025 kern.info kernel: [  573.312132] br-lan: port 5(sfp2) entered forwarding state
Sat Feb 15 11:32:46 2025 kern.info kernel: [  574.338044] mt7530-mdio mdio-bus:1f sfp2: Link is Down
Sat Feb 15 11:32:46 2025 kern.info kernel: [  574.338132] br-lan: port 5(sfp2) entered disabled state
Sat Feb 15 11:32:46 2025 daemon.notice netifd: Network device 'sfp2' link is down
Sat Feb 15 11:32:50 2025 kern.info kernel: [  578.494141] mt7530-mdio mdio-bus:1f sfp2: Link is Up - 2.5Gbps/Full - flow control off
Sat Feb 15 11:32:50 2025 kern.info kernel: [  578.494338] br-lan: port 5(sfp2) entered blocking state
Sat Feb 15 11:32:50 2025 daemon.notice netifd: Network device 'sfp2' link is up
Sat Feb 15 11:32:50 2025 kern.info kernel: [  578.507268] br-lan: port 5(sfp2) entered forwarding state
Sat Feb 15 11:32:52 2025 kern.info kernel: [  580.572244] mt7530-mdio mdio-bus:1f sfp2: Link is Down
Sat Feb 15 11:32:52 2025 kern.info kernel: [  580.572334] br-lan: port 5(sfp2) entered disabled state
Sat Feb 15 11:32:52 2025 daemon.notice netifd: Network device 'sfp2' link is down
Sat Feb 15 11:32:56 2025 kern.info kernel: [  584.728535] mt7530-mdio mdio-bus:1f sfp2: Link is Up - 2.5Gbps/Full - flow control off
Sat Feb 15 11:32:56 2025 kern.info kernel: [  584.728729] br-lan: port 5(sfp2) entered blocking state
Sat Feb 15 11:32:56 2025 kern.info kernel: [  584.741665] br-lan: port 5(sfp2) entered forwarding state
Sat Feb 15 11:32:56 2025 daemon.notice netifd: Network device 'sfp2' link is up
Sat Feb 15 11:32:57 2025 kern.info kernel: [  585.767630] mt7530-mdio mdio-bus:1f sfp2: Link is Down
Sat Feb 15 11:32:57 2025 kern.info kernel: [  585.767720] br-lan: port 5(sfp2) entered disabled state
Sat Feb 15 11:32:57 2025 daemon.notice netifd: Network device 'sfp2' link is down
Sat Feb 15 11:33:01 2025 kern.info kernel: [  589.924071] mt7530-mdio mdio-bus:1f sfp2: Link is Up - 2.5Gbps/Full - flow control off
Sat Feb 15 11:33:01 2025 kern.info kernel: [  589.924264] br-lan: port 5(sfp2) entered blocking state
Sat Feb 15 11:33:01 2025 daemon.notice netifd: Network device 'sfp2' link is up
Sat Feb 15 11:33:01 2025 kern.info kernel: [  589.937199] br-lan: port 5(sfp2) entered forwarding state
Sat Feb 15 11:33:02 2025 kern.info kernel: [  590.963222] mt7530-mdio mdio-bus:1f sfp2: Link is Down
Sat Feb 15 11:33:02 2025 kern.info kernel: [  590.963312] br-lan: port 5(sfp2) entered disabled state
Sat Feb 15 11:33:02 2025 daemon.notice netifd: Network device 'sfp2' link is down
Sat Feb 15 11:33:07 2025 kern.info kernel: [  595.119793] mt7530-mdio mdio-bus:1f sfp2: Link is Up - 2.5Gbps/Full - flow control off
Sat Feb 15 11:33:07 2025 kern.info kernel: [  595.119988] br-lan: port 5(sfp2) entered blocking state
Sat Feb 15 11:33:07 2025 daemon.notice netifd: Network device 'sfp2' link is up
Sat Feb 15 11:33:07 2025 kern.info kernel: [  595.132920] br-lan: port 5(sfp2) entered forwarding state
Sat Feb 15 11:33:08 2025 kern.info kernel: [  596.158954] mt7530-mdio mdio-bus:1f sfp2: Link is Down
Sat Feb 15 11:33:08 2025 kern.info kernel: [  596.159043] br-lan: port 5(sfp2) entered disabled state
Sat Feb 15 11:33:08 2025 daemon.notice netifd: Network device 'sfp2' link is down

i never had this problem before.
Now i have to connect my cable in one of the LAN ports to regain network access.
It's not a cable problem, i'm using a brand new cat7 cable.
i'm using a TP-LINK TL-SM410U rev 2.0 SFP to RJ45 module, i bought from here almost 2 years ago. This module only support 2.5Gbps speed, it never worked at 1Gbps.

root@OpenWrt:~# ethtool sfp2
Settings for sfp2:
        Supported ports: [ FIBRE ]
        Supported link modes:   2500baseX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  2500baseX/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 2500Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Supports Wake-on: d
        Wake-on: d
        Link detected: no
root@OpenWrt:~#

Please check two things for me:

  1. Does the SFP work well if inserted to SFP1 cage (eth1) instead?
  2. Please check if EEE might be the cause:
ethtool --show-eee sfp2

If EEE is enabled, please disable it and check if the problem persists (and report, because the default should not have changed):

ethtool --set-eee sfp2 eee off
1 Like
  1. This is hard to check, because i have to change all my configuration as SFP1 is my wan port used with a GPON (MA5671A) inside.
  2. ethtool --show-eee sfp2 result is : netlink error: No such device

A little update, 30 min after reporting the issue here, i pluged my cable in the module again and it worked without any issue up to now...so 2 days without any problem.

Hi,

I am trying to upgrade the emmc, but I got stuck in recovery mode, where only a firmware upgrade is avalable, nothing more is saved on reboot.
I am on 23.05.5 (NAND) and 23.05.3 on EMMC.
It is not possible to force the upgrade using Luci, even without keeping settings.

I tried the following steps:

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

I tried:

fw_setenv bootcmd "run emmc_init ; env default bootcmd ; saveenv ; saveenv ; reset"
reboot

Changing the jumpers after reboot

So my NAND is the only working backup, and I like to keep it like that (upgrade NAND when emmc is working again, so one living backup still exists (strong pro point for this router, complexity of it on the other hand...).

In the BPI instruction (BPI instruction) multiple images are mentioned, where I can only find only one sdcard image in the downloads here.

Given my setup, are there supported steps for getting my emmc working again, of can you help me figger this out.

Thanks!

The firmware (and corresponding instructions) from BPI are not official OpenWrt and are not compatible. The file mtk-bpi-r3-EMMC-WAN1-SFP1-20220619-single-image.img

The best way is to use the sdcard image from openwrt.org.

Hi Daniel,

Thanks for your input, I will follow the instructions and on openwrt.org, but...
So I can use the sdcard image for the emmc?
I found the steps to copy an image on the bpi page, and have not found how to do this on the openwrt page.

I found credited to you instructions in this topic, but tried these already (and this is not an image copy).

So how to get the 2024.10 image (and other data) on the emmc, without harming the NAND part?

Hope you can give me some more tips, very much appreciated!

you can follow the steps from this page :

And get the sdcard image to flash from here :
https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/openwrt-24.10.0-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz

I've read the page and it is mostly based on the uart, very difficult in my case ánd destroying my nand image as it moves from sdcard to nand tot emmc (and I want my nand not changed as long as I don't have a working emmc..
What I am looking for are the commands to move data from an usb stick to emmc. I noticed that booting from nand both are available.

Who can help me with that?

I think the cause of this is the resize of partitions.
I changed the emmc using the empty space and then did a run of resize2fs. All space was available to / and I was able to work with it. That is the moment I started the sysupgrade and there I suspect it went wrong.

So the trick might be how to reset the emmc, this is what I see in cfdisk:

                                  Disk: /dev/mmcblk0
                    Size: 7.28 GiB, 7818182656 bytes, 15269888 sectors
               Label: gpt, identifier: 5452574F-2211-4433-5566-778899AABB00

    Device                  Start          End      Sectors      Size Type
    /dev/mmcblk0p1             34         8191         8158        4M BIOS boot
    /dev/mmcblk0p2           8192         9215         1024      512K Linux filesystem
    /dev/mmcblk0p3           9216        13311         4096        2M Linux filesystem
    /dev/mmcblk0p4          13312        24575        11264      5.5M EFI System
>>  /dev/mmcblk0p5          24576       131054       106479       52M EFI System          
    /dev/mmcblk0p6         131072     15269256     15138185      7.2G unknown

If I understood it correctly, p5 and p6 are joined and that's where the procedure fails in upgrading.
So I deleted these two and now it is like this:

                                    Disk: /dev/mmcblk0
                    Size: 7.28 GiB, 7818182656 bytes, 15269888 sectors
               Label: gpt, identifier: 5452574F-2211-4433-5566-778899AABB00

    Device                 Start          End      Sectors      Size Type
>>  /dev/mmcblk0p1            34         8191         8158        4M Linux filesystem     
    /dev/mmcblk0p2          8192         9215         1024      512K Linux filesystem
    /dev/mmcblk0p3          9216        13311         4096        2M Linux filesystem
    /dev/mmcblk0p4         13312        21503         8192        4M EFI System
    Free space             22528     15269854     15247327      7.3G


I expected booting from nand and issuing the following would recreate in a default state what I deleted, but I must do something more I guess:

fw_setenv bootcmd "env default bootcmd ; saveenv ; saveenv ; run emmc_init ; bootmenu 0"

I also tried dd for replacing the data, but it is not bootable anymore from emmc, also no recovery in tmpfs.
I also noticed my partitions are a little different with lsblk:

START   SIZE FSTYPE NAME        PARTLABEL
      122.5M ubi    mtdblock0   
          2M        mtdblock1   
          3M        mtdblock2   
        512K        mtdblock3   
        7.3G        mmcblk0     
   34     4M        ├─mmcblk0p1 bl2
 8192   512K        ├─mmcblk0p2 ubootenv
 9216     2M        ├─mmcblk0p3 factory
13312     4M        └─mmcblk0p4 fip

The bl2 partition is new for me, not visible in other examples (may this be a cause of things go wrong?)
So how to continue effectively wiping emmc to get restarted on the emmc?

After 1 week without any problem, it started again. My Bpi-r3 was not responding anymore, no internet access...
i'm back to 23.05.5

In 15 days no reponse to my post.

What I am doing wrong in the router or in this post (bad language?), who can give me some tips?