Banana Pi R3 mini........I'm lost

so your nand is still broken? then i would avoid changing anything on emmc…if you break this, you cannot boot without tricks (ramboot)

btw. built my initrd with ubi-support

https://drive.google.com/drive/folders/1_UtkNl0S44_Xy46NAEn1KoFDSOkQwAsb?usp=drive_link

rootfs_bpi-r4_lvm+ubi.cpio.zst

and you cannot write directly over ssh to a device…you have to copy the file to remote first and then flash

Yes, NAND is still broken but I was able to succesfully load Rooter firmware back in to eMMC. The R3 mini is functional using eMMC.

I’ll try to fix NAND again this morning using your updated files. Thank you for the help and patience!

Eric

Frustrating…

I started minicom; connected UART; powered on R3 mini; stopped at the UBOOT menu; selected EXIT to get to the MT7986> propmpt.

Entered the following commands successfully:

fatload usb 0:1 $loadaddr bpi-r3-6.6.68-main.itb
setenv rdaddr 0x48000000
setenv bootargs "debug=7 root=root /dev/ram0 rw initrd=${rdaddr},20M"
fatload usb 0:1 ${rdaddr} rootfs_bpi-r4_lvm+ubi.cpio.zst
bootm ${loadaddr}#conf-emmc-mini

Entered 'root" at the Buildroot prompt

mounted the USB drive successfully

# insmod mtd-rw.ko i_want_a_brick=1
insmod: can't insert 'mtd-rw.ko': No such file or directory
# mtd write /mnt/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-preloa
der.bin /dev/mtd0
-sh: mtd: not found
# cp /mnt/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-preloader.bin /dev
/mtd0
# ubidetach -m 1
ubidetach: error!: cannot detach mtd1
           error 19 (No such device)

Maybe I’ll just have to settle for having an R3 mini with a broken NAND.

Eric

The initrd is only userspace…maybe kernel needs ubi too (but i thought i have),but not as module…it needs to be builtin to work also with initrd

If I stop at the UBOOT menu under minicom, I can get to three different areas:

  1. I can boot to PRODUCTION. This brings up the Rooter firmware. At the command prompt I can see the mtdx and ubix directories. The USB drive mounts correctly. BUT the Rooter firmware does not have mtd installed.

  2. I can boot to RECOVERY. This brings up the OpenWrt that was installed when I updated the eMMC. The USB drive does not mount; no sdax entries under /dev. I can see the mtdx and ubix directories. No connectivity through the ethernet cable to a browser at 192.168.1.1

  3. I can hit EXIT and come to the MT7986> prompt. I can mount the USB. mtd command does not work. I do not see mtd1 directory?

I think I’ll just leave the R3 mini as is.

Eric

Frank-W, thank you again for your help and patience.

More testing…I can now boot in to NAND and see the UBOOT menu. The R3 mini boots to OpenWrt (under NAND) with the UART adapter connected through minicom.

What I did:

I created a custom version of the Rooter firmware and included the kmod-mtd-rw package in the kernel. I then installed the custom version to eMMC and was able to execute the NAND restore commands at the Rooter prompt under minicom:

insmod mtd-rw.ko i_want_a_brick=1

mtd write /mnt/sda1/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-preloader.bin /dev/mtd0
ubidetach -m 1
ubiformat /dev/mtd1
ubiattach -m 1
volsize=$(wc -c < /mnt/sda1/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-bl31-uboot.fip)
ubimkvol /dev/ubi0 -N fip -n 0 -s $volsize -t static
ubiupdatevol /dev/ubi0_0 /mnt/sda1/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
cd /lib/firmware/airoha
cat EthMD32.dm.bin EthMD32.DSP.bin > /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -N en8811h-fw -n 1 -s 147456 -t static
ubiupdatevol /dev/ubi0_1 /tmp/en8811h-fw.bin
ubimkvol /dev/ubi0 -n 2 -N ubootenv -s 126976
ubimkvol /dev/ubi0 -n 3 -N ubootenv2 -s 126976
volsize=$(wc -c < /mnt/sda1/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb)
ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
ubiupdatevol /dev/ubi0_4 /mnt/sda1/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb
volsize=$(wc -c < /mnt/sda1/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb)
ubimkvol /dev/ubi0 -n 5 -N fit -s $volsize
ubiupdatevol /dev/ubi0_5 /mnt/sda1/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
ubimkvol /dev/ubi0 -n 6 -N rootfs_data -m

The commands executed successfully with the exception of the following command:

root@ROOter:/lib/firmware/airoha# ubimkvol /dev/ubi0 -n 5 -N fit -s $volsize
[  966.017853] block ubiblock0_5: created from ubi0:5(fit)
Volume ID 5, size 93 LEBs (11808768 bytes, 11.2 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "fit", alignment 1
root@ROOter:/lib/firmware/airoha# [  966.173274] mtdblock_open: 6 callbacks suppressed
[  966.173283] mtdblock: MTD device 'bl2' is NAND, please consider using UBI block devices instead.
[  966.186784] mtdblock: MTD device 'bl2' is NAND, please consider using UBI block devices instead.
[  966.201732] mtdblock: MTD device 'ubi' is NAND, please consider using UBI block devices instead.
[  966.210645] mtdblock: MTD device 'ubi' is NAND, please consider using UBI block devices instead.
[  966.237249] mtdblock: MTD device 'bl2' is NAND, please consider using UBI block devices instead.
[  966.246101] mtdblock: MTD device 'bl2' is NAND, please consider using UBI block devices instead.
[  966.260950] mtdblock: MTD device 'ubi' is NAND, please consider using UBI block devices instead.
[  966.269808] mtdblock: MTD device 'ubi' is NAND, please consider using UBI block devices instead.
[  966.336641] /dev/ubiblock0_5: Can't open blockdev
[  966.342031] /dev/ubiblock0_5: Can't open blockdev
[  966.347211] /dev/ubiblock0_5: Can't open blockdev
[  966.352450] /dev/ubiblock0_5: Can't open blockdev
[  966.357855] F2FS-fs (ubiblock0_5): Magic Mismatch, valid(0xf2f52010) - read(0xffffffff)
[  966.365924] F2FS-fs (ubiblock0_5): Can't find valid F2FS filesystem in 1th superblock
[  966.373772] F2FS-fs (ubiblock0_5): Magic Mismatch, valid(0xf2f52010) - read(0xffffffff)
[  966.381756] F2FS-fs (ubiblock0_5): Can't find valid F2FS filesystem in 2th superblock
[  966.389968] /dev/ubiblock0_5: Can't open blockdev
[  966.394944] exFAT-fs (ubiblock0_5): invalid boot record signature
[  966.401040] exFAT-fs (ubiblock0_5): failed to read boot sector
[  966.406852] exFAT-fs (ubiblock0_5): failed to recognize exfat type
[  966.414120] /dev/ubiblock0_5: Can't open blockdev

I ignored the message and continued entering the NAND restore commands. I then powered the R3 mini off, switched to NAND and powered it back on. The R3 mini booted and the UBOOT menu came up under NAND.

I do not see any wireless networks for OpenWrt on my laptop.

I cannot connect to the R3 mini with an ethernet cable through a browser using 192.168.1.1. Under minicom i see the following:

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr EA:27:73:B8:F9:F0  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fde9:307e:72db::1/60 Scope:Global
          inet6 addr: fe80::e827:73ff:feb8:f9f0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1691 errors:0 dropped:0 overruns:0 frame:0
          TX packets:159 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:107743 (105.2 KiB)  TX bytes:15974 (15.5 KiB)

eth0      Link encap:Ethernet  HWaddr EA:27:73:B8:F9:F0  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1697 errors:0 dropped:0 overruns:0 frame:0
          TX packets:166 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:132680 (129.5 KiB)  TX bytes:17606 (17.1 KiB)
          Interrupt:121 

eth1      Link encap:Ethernet  HWaddr EA:27:73:B8:F9:F1  
          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)
          Interrupt:121 

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:321 errors:0 dropped:0 overruns:0 frame:0
          TX packets:321 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:25036 (24.4 KiB)  TX bytes:25036 (24.4 KiB)

I guess I’m further along. I might do some additional testing later today.

Rooter firmware comes up on eMMC and I am able to connect to the cellular network.

Eric

I guess nand version from openwrt does not support wifi as this needs firmware and driver as module.

Imho it is more designed as recovery system to have a basic linux system for flashing emmc as productive system.

I just don’t know enough about the OpenWrt files that get loaded and what function they perform?

After I corrupted my Rooter firmware (by trying to upgrade through the luci interface), I downloaded these files from OpenWrt Firmware Selector website on December 31, 2024 to try to fix things:

openwrt-mediatek-filogic-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
openwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-factory.bin
openwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-preloader.bin
openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip
openwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
openwrt-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb
openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-preloader.bin
openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin

I used these OpenWrt files in my various recovery attempts. I noticed the first time that I installed OpenWrt to eMMC using the MT7986> directory, I had the same problems: could not connect through ethernet cable to 192.168.1.1 and no wireless.

I re-installed to eMMC using the OpenWrt files but used the Banana-Pi-R3-Mini-MWAN3-GO2025-01-01-upgrade.itb from Rooter instead of the openwrt-mediatek-filogic-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb from OpenWrt. After that I was able to connect to the R3 mini through the Rooter firmware (wireless and ethernet).

Are the ethernet drivers (airoha-en8811h-firmware) part of the OpenWrt package? If they aren’t, that could be why I could not connect via ethernet cable/192.168.1.1

Eric

my last state was that the airoha firmware needs to be flashed to boot1 of emmc, but afaik this is only for uboot, the linux system normally has the firmwares in /lib/firmware, but maybe driver was modified to load the firmware from boot0 block too because firmware was not officially released when openwrt got r3mini support.

normally it should be the sysupgrade file, but i’m no expert here…you could also try to start initramfs-recovery manually from uboot this should be linux kernel+ initrd

please do not touch emmc while nand is broken…thats why i recommend you loading external linux+initrd, that leaves storage untouched.

i guess rooter does not use the boot1 block for ethernet-firmware in uboot…

this is openwrt-support for r3 mini…there is indeed no install option on emmc for nand

https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/boot/uboot-mediatek/patches/442-add-bpi-r3-mini.patch

but basicly it should be same for r3

https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch#l634

looks like the nand only copies sections from sdmmc, except the bl2, but this has to be done separately (snand_write_bl2)