[BPI-R3 Mini] How to unbricked NAND and EMMC

I cannot help much with openwrt specific stuff,but it looks it loads something from mmc first without error…only has error with the leds (missing config option in uboot?). You can try adding the uboot option to uboot (but i do not know how).

Hello, can not flash nand or emmc, there is no even nand device listed by lsblk. But i have a programmer. Has anyone dump for bpi r3 mini, please?

Hello, Frank-W

I have a Banana Pi R3 Mini (MT7986 SoC) that is now bricked. The problem started when I switched the boot source between eMMC and SNAND.

Now, when powering on, the serial log always stops at:


F0: 102B 0000
FA: 1040 0000
FA: 1040 0000 [0200]
F9: 103F 0000
F3: 0000 0000 [0200]
V0: 0000 0000 [0001]
00: 0000 0000
BP: 2400 0041 [0000]
G0: 1190 0000
EC: 0000 0000 [2000]
T0: 0000 016F [010F]
Jump to BL

NOTICE:  BL2: v2.6(release):
NOTICE:  BL2: Built : 20:16:38, May  7 2023
NOTICE:  WDT: disabled
NOTICE:  CPU: MT7986 (1998MHz)
NOTICE:  EMI: Using DDR4 settings
NOTICE:  EMI: Detected DRAM size: 2048MB
NOTICE:  EMI: complex R/W mem test passed
ERROR:   BL2: Failed to load image id 3 (-2)

  • The board has no SD card slot, only SNAND + eMMC + USB.
  • I tried to force USB Boot (BootROM) with mtkclient by holding the reset button while powering on, but there is no BootROM handshake.
  • The device always tries to boot SNAND/eMMC instead of entering BootROM.

I have access to:

  • Serial console (Waveshare FT232/CH343 USB-TTL).
  • mtkclient installed on PC.

I need your help to:

  1. Force the board into BootROM mode (USB/UART download) — maybe via DIP switch, jumper, or shorting boot strap pins.
  2. Reflash U-Boot / BL2 into SNAND or eMMC so the board can boot again.
  3. Confirm if recovery via UART (X/Ymodem transfer) is possible if BootROM is not accessible.

Thank you.

The uartboot should work independ of bootswitch position.

You need a bl2 and fip for ramboot (you can find them in releases page of my uboot repo) and the mtk_uartboot binary (i have only tested in linux).

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

Just start the mtk_uartboot application with parameters pointing to ram bl2+fip and then poweron your r3mini.

After mtk_uartboot exits start minicom or your preferered uart application on same device and you should have uboot console.

There you can reinstall your preferered os.

Hello Frank-W,

I have a Banana Pi R3 Mini (MT7986 SoC) that is currently not booting properly. The problem started after switching the boot source between eMMC and SPI NAND.

I have mtk_uartboot working to load BL2 + FIP into RAM. Using this, I can reach the U-Boot console via serial.

However, when attempting to boot the board, the serial log shows the following BL2 error:

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 021F [010F]
Jump to BL

NOTICE:  BL2: v2.13.0(release): OpenWrt v2025.07.11~78a0dfd9-1 (mt7986-spim-nand-ubi-ddr4)
NOTICE:  BL2: Built : 19:55:48, Aug 14 2025
NOTICE:  WDT: Cold boot
NOTICE:  WDT: disabled
NOTICE:  CPU: MT7986 (2000MHz)
NOTICE:  EMI: Using DDR4 settings
NOTICE:  EMI: Detected DRAM size: 2048MB
NOTICE:  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:  UBI: scanning [0x200000 - 0x8000000] ...
NOTICE:  UBI: Bad VID magic in block 12 54000090
NOTICE:  UBI: Bad VID magic in block 13 4c520294
NOTICE:  UBI: Bad VID magic in block 14 e01f40f9
NOTICE:  UBI: Bad VID magic in block 15 2540052a
NOTICE:  UBI: Bad VID magic in block 16 ff0300b9
NOTICE:  UBI: Bad VID magic in block 17 fd7bc3a8
NOTICE:  UBI: Bad VID magic in block 18 00000000
NOTICE:  UBI: Bad VID magic in block 19 65747279
NOTICE:  UBI: Bad VID magic in block 20 00000000
NOTICE:  UBI: Bad EC magic in block 21 ffffffff
NOTICE:  UBI: Bad EC magic in block 22 ffffffff
NOTICE:  UBI: Bad EC magic in block 23 ffffffff
NOTICE:  UBI: Bad EC magic in block 24 ffffffff
NOTICE:  UBI: Bad EC magic in block 25 ffffffff
NOTICE:  UBI: Bad EC magic in block 26 ffffffff
NOTICE:  UBI: Bad EC magic in block 27 ffffffff
NOTICE:  UBI: scanning is finished
NOTICE:  UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
NOTICE:  UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
ERROR:   UBI error: No volume named fip could be found
ERROR:   io_dev_init failed for FIP image id 0 (-2)
ERROR:   Image id 3 open failed with -2
ERROR:   BL2: Failed to load image id 3 (-2)

I have attempted to write the OpenWrt SNAND image via U-Boot using RAM-loaded commands, but the board still fails to boot.

Could you please advise:

  1. How to properly install OpenWrt on SNAND using RAM-loaded U-Boot.
  2. Any necessary steps for creating/formatting UBI volumes on SPI NAND before flashing.
  3. If there is a recommended sequence of writing BL2/FIP and OpenWrt images to ensure the board boots correctly.

Thank you for your guidance.

Your ubi does not have a partition with fip label

UBI error: No volume named fip could be found

As i do not use openwrt i have no exact instructions to write.

Creating ubi from uboot is bit complex,so better bootup an kernel with initrd (for example from my kernel and buildroot repo)

Bpi-r3.itb with bootconf conf-emmc-mini (bootm $loadaddr#conf-emmc-mini)

This is how i did for my image on R4

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

This is for openwrt

I found this here in forum: BPI-R3 Mini NAND Restore - #12 by nino_0

If it helps, there is a way to get into Linux directly with mtk_uartboot, skipping uboot all together…

Also, perhaps it is easier to get emmc booting again first.

:fire: BPi-R3 Mini Full Flashing Workflow — Detailed Guide :one: Tools & Hardware

Essential Hardware

PC / Laptop (Windows or Linux)

USB-TTL serial adapter → UART console (for BL2, U-Boot, and OpenWrt shell)

USB Flash Drive (FAT32 formatted, for USB boot / sysupgrade)

Ethernet cable → PC ↔ BPi-R3 Mini WAN port

:two: Software

Flashing & Console

MTK UART Boot Tool (mtk_uartboot.exe) → load BL2 + FIP into RAM via UART

Serial monitor → PuTTY, Tera Term, minicom → UART console

TFTP server → serve NAND/eMMC images (Windows: tftpd64 / Linux: tftpd-hpa)

Web browser → OpenWrt WebUI flash

Optional

Rufus → format USB flash drive to FAT32

scp / wget / curl → copy files to running OpenWrt shell

:three: Firmware / Image Files

UART → RAM loader

bpi-r3mini_ram_bl2.bin → BL2 Preloader

bpi-r3mini_ram_fip.bin → BL31 + U-Boot FIP

Source: UART Loader Google Drive

Old / Official OpenWrt single-image

mtk-bpi-r3mini-mac80211-NAND-YYYYMMDD-single-image.bin → NAND flash

mtk-bpi-r3mini-mac80211-EMMC-YYYYMMDD-single-image.bin → eMMC flash

Source: Old OpenWrt Google Drive

Latest OpenWrt

openwrt-24.10.2-…-initramfs-recovery.itb → RAM boot for safe sysupgrade

openwrt-24.10.2-…-emmc.img → final sysupgrade for eMMC

Files for eMMC flash via old OpenWrt shell

openwrt-emmc-gpt.bin → GPT partition table

openwrt-emmc-preloader.bin → BL2 / preloader

openwrt-emmc-bl31-uboot.fip → BL31 + U-Boot FIP

:four: Step-by-Step Flashing Workflow A. NAND Single-Image via UART Recovery

:one: Boot BL2 + FIP into RAM

“C:\Program Files\mtk_uartboot\target\release\mtk_uartboot.exe” -s COM3 -p bpi-r3mini_ram_bl2.bin --aarch64 -f bpi-r3mini_ram_fip.bin

Temporary U-Boot console appears in RAM.

:two: Configure U-Boot environment

setenv serverip 192.168.1.13 setenv ipaddr 192.168.1.1 setenv loadaddr 0x46000000 saveenv

:three: Load NAND single-image via TFTP

tftpboot ${loadaddr} mtk-bpi-r3mini-mac80211-NAND-YYYYMMDD-single-image.bin

:four: Prepare NAND

ubi detach mtd erase bl2 mtd erase factory mtd erase fip mtd erase ubi

:five: Write the single-image

mtd write spi-nand0 ${loadaddr} 0 ${filesize}

:six: Verify

mtd read spi-nand0 ${loadaddr} 0 0x10000 md ${loadaddr} 0x40

:seven: Reboot

reset

Board boots into OpenWrt NAND.

B. eMMC Single-Image via UART Recovery (Optional if NAND failed)

:one: Boot BL2 + FIP into RAM (if eMMC corrupted) :two: Configure U-Boot network :three: Load eMMC single-image via TFTP :four: Calculate block count and erase eMMC :five: Write image to eMMC :six: Verify :seven: Reboot

Board boots directly from eMMC.

C. Flash GPT / BL2 / BL31 via Old OpenWrt Shell (booted from NAND)

Goal: Write GPT, BL2, and BL31 + U-Boot FIP to eMMC without UART loader, using old OpenWrt shell from NAND.

:one: Copy files to /tmp

cd /tmp tftp -g -r openwrt-emmc-gpt.bin 192.168.1.13 tftp -g -r openwrt-emmc-preloader.bin 192.168.1.13 tftp -g -r openwrt-emmc-bl31-uboot.fip 192.168.1.13

:two: Flash GPT table

dd if=/tmp/openwrt-emmc-gpt.bin of=/dev/mmcblk0 bs=512 seek=0 count=34 conv=fsync fdisk -l /dev/mmcblk0

:three: Flash BL2 / Preloader

echo 0 > /sys/block/mmcblk0boot0/force_ro dd if=/tmp/openwrt-emmc-preloader.bin of=/dev/mmcblk0boot0 bs=512 conv=fsync echo 1 > /sys/block/mmcblk0boot0/force_ro

:four: Flash BL31 + U-Boot FIP

dd if=/tmp/openwrt-emmc-bl31-uboot.fip of=/dev/mmcblk0 bs=512 seek=13312 conv=fsync

:five: Verify

dd if=/dev/mmcblk0 bs=512 skip=13312 count=2048 of=/tmp/bl31_readback.bin cmp /tmp/bl31_readback.bin /tmp/openwrt-emmc-bl31-uboot.fip

:white_check_mark: eMMC now bootable, U-Boot runs from eMMC.

D. Sysupgrade via USB → RAM → WebUI (booted from eMMC)

:one: Boot into eMMC U-Boot

Power-cycle the board → board runs U-Boot from eMMC

:two: Load Sysupgrade to RAM from USB

usb start fatload usb 0:1 0x46000000 openwrt-24.10.2-…-emmc.img bootm 0x46000000

:three: Access OpenWrt WebUI

Navigate: System → Backup / Flash Firmware → Flash new firmware

Select the sysupgrade image (already in RAM or uploaded)

:four: Reboot & verify

lsblk df -h

Confirm rootfs and partitions are correct. :speech_balloon: Acknowledgment Special thanks to Frank-W for the guidance and support during the BPi-R3 Mini flashing workflow.

:warning: Note: This guide was AI-assisted in its preparation. If you find any inaccuracies, typos, or procedural errors, please feel free to correct them. The author and contributors appreciate any feedback to improve clarity and safety.

Hi Frank,

I’m encountering a problem on the BPI-R3 Mini while trying to back up the BL2 region of the SPI-NAND. When using sf read at any RAM address, the CPU triggers a Synchronous Abort, and the system resets. This happens even when splitting the read into smaller chunks.

Details:

  • Board: BPI-R3 Mini
  • SPI-NAND: Winbond 128 MiB, block 128 KiB, page 2048, OOB 64
  • Crash occurs during sf read 0x40000000 0x000000 0x40000 (and other addresses)
  • Similar behavior may occur on eMMC reads of low-level boot partitions
  • Using mtd read also fails unless careful RAM offsets are chosen

It looks like BL2 and other boot regions are protected or not directly accessible via SF read, and standard RAM addresses trigger a synchronous abort.

Could you advise the recommended procedure to safely back up BL2, FIP, factory, and UBI partitions on SPI-NAND and eMMC without causing CPU resets?

Thank you

Use mtd read/write for nand/nor.

Try to use loadaddr of >0x4500000 as ram starts afaik at 0x40000000 and some regmaps (e.g.clock,pinctrl,…) are mapped to this region.

Dear Community!

I have bought an BPI-R3 mini, and I want to use it with my own compiled OpenWRT. At this moment, the device has the stock 21.05 SNAPSHOT version on the NAND and something on the EMMC. I have followed the tutorial, and the result is always the same, after the power remove, switch to EMMC boot this screen is welcome me in serial port, after the uboot menu:

What do i wrong?

Thank you!

So you try to boot mainline openwrt from emmc after installing it with mainline instructions from pre-installed bpi-image on nand,right?

Looks like the fit does not contain the config name which is taken by the script. Either the fit image has changed or the script for booting specific configuration.

You can list your env variables with printenv. For available configurations i only know dumpimage in linux,but no uboot command. Afaik openwrt loads fit image itself from a storage block and not as file from partition you can only try get offset and size of fit from uboot and write this to file after booting linux.

this is the config-name which seems to be taken…but i do not know where openwrt creates the fit which has to include this config

seems like fit is loaded this way:

looks like there is a partition production where all is loaded from and than a fit is extracted from it

fit itself seems to be created from here:

have you a production partition on emmc and executed these steps with the r3mini (not R3) files?

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

I’ve made a mistake at first time. At the first time Unfortunetly i was Inattentive, and i write the simple r3 Images, not the r3-mini. Is it problem? Since then i have wrote the r3-mini Images several time, but the result is the same every time.

the fip has to match the sysupgrade/recovery part. so if you flashed complete image for r3 you have to replace at least fip and the files above with r3mini files

you can check what’s in you r uboot environment set, if this is the right bootconf

printenv bootconf

this should be

bootconf=config-mt7986a-bananapi-bpi-r3-mini

if not you have to flash this

dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3

If i try to boot from EMMC, and enter the command printenv bootconf in the uboot console: image

After I boot from NAND, and type the command:

dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3

image

Power off, EMMC uboot and the result is the same: image

What do i wrong?

So it is definitely the fip pointing to the wrong fit config name.

Are you sure you have downloaded the right file and not renamed or such?

I haven’t renamed anything. How can I restart the whole procedure from the start? I found the tutorial how can restore the default NAND layout, but nothing about EMMC. Is it possible to restore the default EMMC layout? Here is the EMMC layout now: image

What is default? :slight_smile:

Wasn’t there a gpt binary for openwrt?

dd if=/tmp/openwrt-*-r3-mini-emmc-gpt.bin of=/dev/mmcblk0

This should restore partition table after reboot.

Default i mean that the firmware i got from factory. 21.05 snapshot, same like on NAND.

In NAND uboot can i write mtk-bpi-r3mini-EMMC-20231115.img?

The command that You offer, is does nothing :frowning: i have done it several times (5-10) or my EMMC is read only or dead

I copied the command from the openwrt instructions and you have to reboot after it to see new partitions.

Of course you can write the old bpi image,but then you have no up-to-date openwrt.