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

Oh no other typo…nice :stuck_out_tongue:

User root,there is no password

I guess I’m getting further along. I’ve entered the above five commands at the MT7986> prompt. After entering the last command (bootm ${loadaddr}#conf-emmc-mini), it looks like the R3 mini boots up. I hit the “enter” key and am at the Buildroot prompt asking for a login. I type in ‘root’ and hit enter and now have a ‘#’ prompt. I am not familiar with Buildroot or what I’m supposed to do now.

Eric

You can use mount and dmesg like described above

Frank-w,

Thanks for the additional information. Was able to mount the USB drive at the ‘#’ prompt under Buildroot. When entering the commands for the NAND install I received error messages about missing directories.

I did not see mtd1, ubi0 and /lib/firmware/airoha is not there.

Frustrating not knowing how to fix this.

Eric

Mhm,possibly i miss mtd/ubi commands in the initrd sorry. I should add them when doing next build.

Created with this config:

No idea whats missing in openwrt for r3mini to get usb working.

Frank-w,

Thanks for your help so far. I think I’ve reloaded OpenWrt on the emmc but still can’t get the USB drive to mount through the R3 mini.

I can ssh in to the R3 mini using [email protected], but I can’t get a web browser to come up using the 192.168.1.1 ip address.

Eric

Ok, then you could transfer the files via scp/sftp to r3mini to flash them into the ubi

That what I was thinking…It’s been a long time using scp/sftp. Looking for an example to copy from my laptop to the R3 mini. Thanks!

Eric

if your other system is linux then

scp local-file user@ip:path

If using windows qinacp can be used with same data like ssh (port 22)

Just figured out the format of the command. I’m getting a permission denied message. Running Linux Mint.

eric@eric-T14-Gen-3:~/Documents/Banana/DEC31$ scp openwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-preloader.bin [email protected]:/dev/mtd0
scp: /dev/mtd0: Permission denied
eric@eric-T14-Gen-3:~/Documents/Banana/DEC31$

Might need to take break from this for a couple hours…

Eric

Frank-W,

I’ve got the R3 mini back up and running. I can connect through ethernet and wireless. Cellular modem is connected to cellular network and internet/data is working.

Before I “tried” fixing the NAND on the R3 mini, everything was working with the Rooter firmware I had installed last month. After reading through numerous posts I found one that worked. I had to modify it to load the Rooter firmware instead of the OpenWrt firmware. Here’s a link to the post I used followed by a description of what I did:

  • I prepared a USB drive with the latest OpenWrt files along with the Rooter firmware …upgrade.itb file
  • Plugged the USB drive in to the R3 mini
  • Started minicom on my linux laptop in a terminal window: sudo minicom
  • Connected the UART adapter to the R3 mini and plugged the USB into my laptop
  • Connected power to the R3 mini and quickly hit the up/down arrow keys to stay in UBOOT
  • Selected EXIT from the UBOOT menu which brough me to a MT7986> prompt
  • Ran the following commands at the MT7986 prompt:
usb start
ls usb 0:1 
mmc dev 0

#gpt
load usb 0:1 $loadaddr openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin
mmc erase 0x0 0x400 ; mmc write $loadaddr 0x0 0x400

#en8811h (don't work)
load usb 0:1 $loadaddr EthMD32.dm.bin
mmc partconf 0 1 2 2 ; mmc erase 0x0 0x20 ; mmc write $loadaddr 0x0 0x20 ; mmc partconf 0 1 1 0
load usb 0:1 $loadaddr EthMD32.DSP.bin
mmc partconf 0 1 2 2 ; mmc erase 0x20 0x100 ; mmc write $loadaddr 0x0 0x100 ; mmc partconf 0 1 1 0

#bl2
load usb 0:1 $loadaddr openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-preloader.bin
mmc partconf 0 1 1 1 ; mmc erase 0x0 0x400 ; mmc write $loadaddr 0x0 0x400 ; mmc partconf 0 1 1 0

#fip
load usb 0:1 $loadaddr openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip
mmc erase 0x3400 0x2000 ; mmc write $loadaddr 0x3400 0x2000
//mmc erase 0x2000 0x800 (I do not know why this is, but it was in the source code)

#tftp...

mmc dev 0 0

load usb 0:1 $loadaddr openwrt-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb
mmc erase 0x6000 0xFFFF ; mmc write $loadaddr 0x6000 0xFFFF

load usb 0:1 $loadaddr Banana-Pi-R3-Mini-MWAN3-GO2024-12-25-upgrade.itb
mmc erase 0x20000 0x33FFF ; mmc write $loadaddr 0x20000 0x33FFF

After entering the above commands, I typed ‘boot’ at the MT7986 prompt. This restarted the R3 mini. It appeared to boot twice, coming up with OpenWrt in recovery? Not sure? I powered the R3 mini off, then powered it on and selected #3 Boot from Production from the UBOOT menu. Rooter firmware came up in the terminal window.

I was able to then access the GUI through the 192.168.1.1 ip address. I finished setting up wireless and the cellular modem and am back online.

I might try to fix NAND since Rooter recognizes the USB drive when plugged in to the R3 mini.

Hope this helps.

Eric

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)