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?

Is my question that much out of order?
Is this too difficult?
Is it so strange prefering an upgrade path what keeps what is working, knowing one path allready failed?

I am puzzled...

It's a bit of an "where to even start?" moment and I was hoping someone else would reply...

So: you can not use the SD card image and write it to the eMMC. This won't work. On eMMC, the boot0 hardware partition is used for storing bl2, so there is no bl2 GPT partition then. Use the SD card image to write it to an SD card.

Forget about the BPI instructions when using vanilla OpenWrt, there fork is really different and they provide multiple images for the same board (which we try to avoid). The installation also works differently.

You also cannot mix BPI's nameless OpenWrt-fork with vanilla OpenWrt as both have different definitions when it comes to the NAND flash (ie. have one on the eMMC and the other one on the SPI-NAND, you can't do that). It's either or.

While this is possible it is not intended, not easy and not documented. As it is anyway not possible to have BPI's fork on the NAND flash while using vanilla OpenWrt on the eMMC (because vanilla OpenWrt would UBI-format the NAND, even when booting from eMMC) it's also pointless to try that.

1 Like

Great you're trying to help , much appreciated!

The USB port is able to be mounted, when booting from nand ĂĄnd have access to emmc.

Isn't there an opening when wanting to have a bootable medium (a prepared USB) being able to transfer data to emmc?

Isn´t it then just creating the right partitions (I don´t need much as an example but I need something to get me started), filling them in the right way? I hope there are dd commands thinkable to copy the boot data from the usb, of does that need to be from the booted media (what also could help in getting it bootable again with the nand image boot data)?

I hope you can help fill some gaps (what type of partitions to be created and how to assing the right role and filling them with the right data)?

Sure, you could do that. However, as soon as you would boot OpenWrt from the eMMC, it would destroy the SinoVoip firmware on the SPI-NAND because it would intialize UBI structure at an offset on the flash where the SinoVoip firmware doesn't expect that.

Yes, that's true. And you also got to take care of the boot0 hardware partition.

Can the BPI-R3 do zero-wait DFS? I don't really understand the hardware requirements for it, and the first time I ever even heard of this feature was in discussion of the OpenWrt One.

If it can, how do I go about enabling it?

Hello.
I would like to connect DS18B20 temperature (one wire) sensor to the board.
What GPIO PIN is the best for this purpose? And How I can activate w1 bus on selected pin?
OpenWRT 24.10.0
Thanks.

You will have to create a DT overlay (similar to the existing overlay for the "ReSpeaker 2-mic" audio device).
Any GPIO pin will do as there is no hardware implementation of the 1-wire protocol, it will have to be bit-banged using kmod-w1-master-gpio.
Your DS18B20 temperature sensor is supported by kmod-w1-slave-therm.

Hello,
since openwrt 24.10, when i reboot the BPI-R3, my gpon ONT Nokia G-010S-P display this message at startup : EEPROM base structure checksum failure: 0x7c != 0x00

root@OpenWrt:~# logread | grep "sfp"
Thu May  8 09:54:52 2025 kern.info kernel: [   12.562771] sfp sfp-1: Host maximum power 3.0W
Thu May  8 09:54:52 2025 kern.info kernel: [   12.567825] sfp sfp-2: Host maximum power 3.0W
Thu May  8 09:54:52 2025 kern.err kernel: [   12.891510] sfp sfp-1: EEPROM base structure checksum failure: 0x7c != 0x00
Thu May  8 09:54:52 2025 kern.err kernel: [   12.898467] sfp EE: 00000000: 03 04 01 00 00 00 00 00 00 00 00 03 19 00 00 c8  ................
Thu May  8 09:54:52 2025 kern.err kernel: [   12.907143] sfp EE: 00000010: 00 00 00 00 40 40 42 40 40 41 00 00 00 00 00 00  ....@@B@@A......
Thu May  8 09:54:52 2025 kern.err kernel: [   12.915818] sfp EE: 00000020: 00 20 20 20 00 00 00 00 46 00 11 10 41 50 00 00  .   ....F...AP..
Thu May  8 09:54:52 2025 kern.err kernel: [   12.924493] sfp EE: 00000030: 00 00 00 00 00 00 00 00 30 30 20 20 01 14 00 00  ........00  ....
Thu May  8 09:54:52 2025 kern.err kernel: [   12.933167] sfp EE: 00000040: 40 b7 ba 7f 80 ff ff ff 20 3d f8 80 c0 ff ff ff  @....... =......
Thu May  8 09:54:52 2025 kern.err kernel: [   12.941842] sfp EE: 00000050: fc 7e 07 80 c0 ff ff ff 30 3d f8 80 c0 ff ff ff  .~......0=......
Thu May  8 09:54:52 2025 kern.info kernel: [   12.980030] sfp sfp-2: module OEM              SFP-2.5G-T-R-RM  rev 1.0  sn 2412190031       dc 241219
Thu May  8 09:54:54 2025 kern.info kernel: [   15.657039] mt7530-mdio mdio-bus:1f sfp2: configuring for inband/2500base-x link mode
Thu May  8 09:54:54 2025 kern.info kernel: [   15.658782] br-lan: port 5(sfp2) entered blocking state
Thu May  8 09:54:54 2025 kern.info kernel: [   15.658804] br-lan: port 5(sfp2) entered disabled state
Thu May  8 09:54:54 2025 kern.info kernel: [   15.658852] mt7530-mdio mdio-bus:1f sfp2: entered allmulticast mode
Thu May  8 09:54:54 2025 kern.info kernel: [   15.661098] mt7530-mdio mdio-bus:1f sfp2: entered promiscuous mode
Thu May  8 09:54:59 2025 daemon.notice netifd: Network device 'sfp2' link is up
Thu May  8 09:54:59 2025 kern.info kernel: [   20.569236] mt7530-mdio mdio-bus:1f sfp2: Link is Up - 2.5Gbps/Full - flow control off
Thu May  8 09:54:59 2025 kern.info kernel: [   20.569435] br-lan: port 5(sfp2) entered blocking state
Thu May  8 09:54:59 2025 kern.info kernel: [   20.569444] br-lan: port 5(sfp2) entered forwarding state

so my ONT doesn't work until I take it out and put it back in its SFP cage.

Thu May  8 09:57:42 2025 kern.info kernel: [  183.978797] sfp sfp-1: module removed
Thu May  8 09:57:46 2025 kern.info kernel: [  187.645213] sfp sfp-1: module removed
Thu May  8 09:57:46 2025 kern.info kernel: [  187.981352] sfp sfp-1: module ALCATELLUCENT    G010SP           rev 10   sn ALCLFAB44018     dc 161205

i don't have this problem with my other ONT Huawei MA5671A.

How can we fix this problem ?