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

Folks,

I purchased a Banana Pi R3 mini in November and did the following to load the Rooter firmware on the device on eMMC:

  1. Set boot switch to boot from SPI-NAND (assuming stock rom is running there).

  2. copy all the files to a USB drive that gets inserted in the Banana Pi 3 Mini.

  3. cd /mnt/sda1/

  4. cp openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin /tmp

  5. dd if=/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin of=/dev/mmcblk0

  6. Reboot (to reload partition tables)

  7. cp openwrt-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb /tmp cp openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-preloader.bin /tmp cp openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip /tmp cp Banana-Pi-R3-Mini-full-GO2024-11-13-upgrade.itb /tmp

  8. echo 0 > /sys/block/mmcblk0boot0/force_ro dd if=/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0 dd if=/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3 dd if=/tmp/openwrt-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4 dd if=/tmp/Banana-Pi-R3-Mini-full-GO2024-11-13-upgrade.itb of=/dev/mmcblk0p5
    sync

  9. Remove the device from power, set boot switch to eMMC and boot into OpenWrt. The device will come up with IP 192.168.1.1 and assume the Ethernet port closer to the USB-C power connector as LAN port.

I was able to set up the Rooter firmware, install my RM520N-GL modem and get everything working.

I have been using the R3 mini for the past month or so without issue.

I decided to boot in to NAND, but got no response from the R3 mini (no connectivity via ethernet, no wireless). I connected the UART and see the following:

F0: 102B 0000
FA: 1040 0000
FA: 1040 0000 [0200]
F9: 0000 0000
V0: 0000 0000 [0001]
00: 0000 0000
BP: 2400 0041 [0000]
G0: 1190 0000
EC: 0000 0000 [1000]
T0: 0000 021E [010F]
Jump to BL

NOTICE:  BL2: v2.6(release):
NOTICE:  BL2: Built : 20:18:14, May  7 2023
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:  SPI_NAND parses attributes from parameter page.
NOTICE:  SPI_NAND Detected ID 0xef
NOTICE:  Page size 2048, Block size 131072, size 134217728
NOTICE:  Initializing NMBM ...
NOTICE:  NMBM management region starts at block 960 [0x07800000]
NOTICE:  NMBM has been initialized in read-only mode
ERROR:   BL2: Failed to load image id 3 (-2)

To make matters worse, I tried upgrading OpenWrt through Luci under the Rooter firmware. The R3 mini boots up but there is no connectvity (ethernet and wireless). Under minicom I see the following:

    ( ( ( OpenWrt ) ) )  [eMMC]       U-Boot 2024.10-OpenWrt-r28146-52b6c92479 (Nov 21 2024 - 21:04:41 +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.
  0. Exit

Press UP/DOWN to move, ENTER to select, ESC to quit

If I select option 1, 3 or 4 the R3 mini boots up and then stops. Once I hit the “enter” key it continues to boot and brings me to an OpenWrt prompt:

BusyBox v1.36.1 (2024-11-21 21:04:41 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r28146-52b6c92479
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~#

I’m not sure what I need to do to restore either the eMMC or the NAND. Any help is greatly appreciated. Thanks.

Eric

I’m not sure how to get the “cut and paste” from minicom to format correctly? Sorry for the difficult post to read.

Eric

You can select the text (edit your post with the pen icon) and press the code button (<>) or manuall adding the 3 backticks before and after

For the firat post…the emmc should be ok,but nand seems broken. I thought openwrt had an option to install to nand after booting into emmc uboot…but there is noch option in menu

Daniel posted a guide which i had stored in my wiki

https://wiki.fw-web.de/doku.php?id=en:bpi-r3mini:start#nand_install

frank-w,

Thank you for the formatting tips. I’ll take a look at the link you posted.

Eric

frank-w,

I’m reading the post on nand_install. How do I get the files to /tmp?

If I boot up the R3 mini, I can get to the root@OpenWrt:~# prompt ,but can’t see my USB drive connected to the R3 mini?

If I boot up the R3 mini and select ‘exit’ from the u-boot menu, it brings me to an MT7986> prompt.

Not sure how to proceed? Thanks.

Eric

When your usb drive is inserted you can see its device (sdX) in dmesg and then mount its partition /dev/sdX1 to a local dir and then ypu can flash from there…no need to copy to /tmp

dmesg | grep sd
mount /dev/sdX1 /mnt

And then use /mnt instead of /tmp

Have not done anything with ubi,so cannot help much more.

Hmmmm…not seeing anything under /dev directory with an ‘sd’ prefix.

root@OpenWrt:~# dmesg | grep sd
[    2.200900] mtk-msdc 11230000.mmc: Final PAD_DS_TUNE: 0x14014

USB drive is inserted in the R3 mini.

I can see it under the MT7986> prompt by typing the following:

usb start
fatls usb 0:1

I guess you can flash in uboot too,but ubi and partition handling is more ticky.

Mhm,usb not working in openwrt linux? Was working with debian and my tree…kernel is same as for r3,but different boot config

bpi-r3-6.6.68-main.itb

Initrd can be found on my gdrive

Related commands are here,also for initrd

https://wiki.fw-web.de/doku.php?id=en:bpi-r3:uboot#booting_kernel

Something like this

BPI-R3> fatload usb 0:1 $loadaddr bpi-r3.itb
17032308 bytes read in 1427 ms (11.4 MiB/s)

BPI-R3> setenv rdaddr 0x48000000
BPI-R3> setenv bootargs "debug=7 root=root "/dev/ram0 rw initrd=${rdaddr},20M"
BPI-R3> fatload usb 0:1 ${rdaddr} rootfs_bpi-r3_lvm.cpio.zst

BPI-R3> bootm ${loadaddr}#conf-emmc-mini 

Frank-w,

Thank you for you help and patience. I’ve tried executing the following code (I’ve changed the bpi-r3.itb to bpi-r3-6.6.68-main.itb):

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

I’m getting the following prompt:

Welcome to Buildroot
buildroot login:

Not sure where to go from here?

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