[BPI-R3 mini] Install OpenWRT on BPI R3-mini (my way and issue)

If you have a linux client you can always do uart-boot also if spi and emmc broken and reflash them from the uboot

But as eric says for first steps make sure 1 device still works (e.g. only flash to emmc to have spi untouched).

Okay, I’ll use emmc memory for my test. Thank u team!

I found this snapshot, I’ll try to install it. https://firmware-selector.openwrt.org/?version=SNAPSHOT&target=mediatek%2Ffilogic&id=bananapi_bpi-r3-mini

image

Correct me if I misunderstood. This is a very recent snapshot taken 2024-07-07 08:13:02. But for firmware it will not be enough to simply use the Sysupgrade image. In order for this snapshot to work I need to use: 1.EMMC-GPT.bin 2.EMMC-PRELOADER.bin 3. KERNEL

I’m right?

Yes upgrade from bpi image mostly does not work and you need to do first install as full flash

Hi @frank-w ! Thanks for youre support!

As I understand it, now it is necessary to assemble an ISO image from these binaries. I’m right? If this is the case, then I will create a separate topic to discuss the process of creating the image.

Yes,it should create a full image for emmc…

This may seem like a stupid question to you, but I’m trying to figure it out. In this topic, I advanced in the emmc firmware and got into a dead end. Now I can boot in emmc and have access via ssh:

II followed all these steps for eMMC.

nstallation instructions for eMMC
----------------------------------
0. Set boot switch to boot from SPI-NAND (assuming stock rom or immortalwrt
   running there).
1. Write GPT partition table to eMMC
   Move openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin to
   the device /tmp using scp and write it to /dev/mmcblk0:
    dd if=/tmp/openwrt-*-r3-mini-emmc-gpt.bin of=/dev/mmcblk0
2. Reboot (to reload partition table)
3. Write bootloader and OpenWrt images
   Move files to the device /tmp using scp:
    - openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin
    - openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip
    - openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
    - openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
   Write them to the appropriate partitions:
    echo 0 > /sys/block/mmcblk0boot0/force_ro
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb of=/dev/mmcblk0p5
    sync

4. 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.
  1. Switched R3 mini to eMMC boot
  2. I launched it and gained access via SSH.
  3. Switched R3 mini back to NAND.
  4. But NAND is no longer available.

What does this mean? You cannot boot from nand? Which error-message do you have?

I can’t get logs during startup from NAND memory because I can’t access the OS through more than one of the R3 mini interfaces. In order to get debaglogs I need a uart-usb. Am I positioning it correctly?

Therefore, I cannot say what happens when I try to boot from NAND. The fact is that I have not flashed this type of memory, and I cannot understand why the eMMC firmware affected the NAND partition.

emmc should not affect nand as this is different memory on different controllers, i only have flashed emmc (debian and not openwrt) and can still boot stock nand. so i wonder why your nand is also broken.

yes you need a debug-uart to see whats going on here…

In the next few days I will be waiting for a uart (based on FT232RL) to extract the debaglogs. I’ll be back with the result.

If you want official OpenWRT and another OS (including OpenWRT flavors) on R3 mini, OpenWRT should be installed on NAND and the other on eMMC. Current (snapshot) OpenWRT if installed on eMMC it will alter the NAND.

1 Like
➜  mtk_uartboot-v0.1.1-aarch64-apple-darwin sudo ./mtk_uartboot -s /dev/tty.usbserial-110 --aarch64 --payload bpi-r3mini_ram_bl2.bin --fip bpi-r3mini_ram_fip.bin

Password:
mtk_uartboot - 0.1.1
Using serial port: /dev/tty.usbserial-110
Handshake...
hw code: 0x7986
hw sub code: 0x8a00
hw ver: 0xca01
sw ver: 0x1
Baud rate set to 460800
sending payload to 0x201000...
Checksum: 0x3663
Setting baudrate back to 115200
Jumping to 0x201000 in aarch64...
Waiting for BL2. Message below:
==================================
NOTICE:  BL2: v2.9(release):v2.9.0-357-g553a16af808e ram
NOTICE:  BL2: Built : 17:17:10, Mar  3 2024
NOTICE:  WDT: [a0000000] Watchdog timeout
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:  Starting UART download handshake ...
==================================
BL2 UART DL version: 0x10


NOTICE: WDT: [a0000000] Watchdog timeout How to solve ?

Which bl2/fip do you use? It looks like you use not a ram-prepared bl2 for mtk_uartboot - edit: seems you use my files so it should work…sorry scrolled out the command

@ggg70 where do you have this information? Can you point to code where emmc openwrt changes nand?

The problem appears if you do sysupgrade from OpenWRT when it is on eMMC. I don’t know where is the problem exactly, I suppose it is in some upgrade script, Daniel confirmed here: https://forum.openwrt.org/t/openwrt-support-for-banana-pi-bpi-r3-mini/175011/9 that the working variant is to have OpenWRT on NAND and other OS on eMMC.

1 Like

As I promised, here is the boot log on the NAND memory partition. Now I continue to study the forum to find a solution.

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)

I was able to boot into u-boot. Run this command:

.\mtk_uartboot.exe -s COM3 --aarch64 --payload .\bpi-r3mini_ram_bl2.bin --fip .\bpi-r3mini_ram_fip.bin

Use Mobaxter/putty for connection via uart-usb (COM-3)

BPI-R3M> help

Now I encountered such a problem when executing the command

usb start

BPI-R3M> usb start
starting USB...
Bus xhci@11200000: xhci-mtk xhci@11200000: hcd: 0x0000000011200000, ippc: 0x0000000011203e00
xhci-mtk xhci@11200000: ports disabled mask: u3p-0x0, u2p-0x0
xhci-mtk xhci@11200000: u2p:2, u3p:1
Register 300010f NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus xhci@11200000 for devices... usb_new_device: Cannot read configuration, skipping device 058f:6387
1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

I’m using USB-2.0/16Gb/FAT32

P.S.

THE PROBLEM WAS IN THE USB drive. (CHANGE USB Flash)

Here is a scheme with instructions that clearly shows the process of installing OpenWTR from eMMC and NAND.

Links:

Can write eMMC

Broken SinoVoip EMMC

Restore SinoVoip NAND

Thank you all so much for taking the time to help me figure this out.

@frank-w @ggg70 @zuowei8 @ericwoud @QooGeek