[BPI-R4] How to get an openwrt image to eMMC?

Hello! I have been building my own version of openwrt for a while and now I have been using that with the SD image flashed to… an SD.

Now, when I build I get all of these output files:

mt7981-ram-ddr3-bl2.bin
mt7981-ram-ddr4-bl2.bin
mt7986-ram-ddr3-bl2.bin
mt7986-ram-ddr4-bl2.bin
mt7988-ram-comb-bl2.bin
openwrt-mediatek-filogic-bananapi_bpi-r4-emmc-bl31-uboot.fip
openwrt-mediatek-filogic-bananapi_bpi-r4-emmc-preloader.bin
openwrt-mediatek-filogic-bananapi_bpi-r4-initramfs-recovery.itb
openwrt-mediatek-filogic-bananapi_bpi-r4.manifest
openwrt-mediatek-filogic-bananapi_bpi-r4-sdcard.img.gz
openwrt-mediatek-filogic-bananapi_bpi-r4-snand-bl31-uboot.fip
openwrt-mediatek-filogic-bananapi_bpi-r4-snand-preloader.bin
openwrt-mediatek-filogic-bananapi_bpi-r4-squashfs-sysupgrade.itb

How can I install the same build first on the NAND and then on the eMMC?

Thank you!

Afair it is designed to boot the sdcard one first and then install to nand from it,then boot this and install emmc

Yeah, I tried to use the process in Getting Started BPI-R4 | BananaPi Docs assuming is the same but then I get to:

root@OpenWrt:/mnt# mtd erase /dev/mtd0
Could not open mtd device: /dev/mtd0
Could not open mtd device: /dev/mtd0
root@OpenWrt:/mnt# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00200000 00020000 "bl2"
mtd1: 07e00000 00020000 "ubi"

Any clue on what am I missing?

Do not use the bpi way here…mainline openwrt is installed using uboot menu

But if I want to boot something else in NAND and install an OpenWRT directly to emmc anyone know which is the procedure? I’m having trouble with the bl31-uboot as well. I tried with mmcblk0p4 and mmcblk0p3 without success.

dd if=openwrt-mediatek-filogic-bananapi_bpi-r4-emmc-bl31-uboot.fip of=/dev/mmcblk0p4

I’m getting:

NOTICE:  BL2: v2.13.0(release):OpenWrt v2025.07.11~78a0dfd9-1 (mt7988-emmc-comb)
NOTICE:  BL2: Built : 23:20:01, Feb  4 2026
NOTICE:  WDT: Cold boot
NOTICE:  WDT: disabled
NOTICE:  CPU: MT7988
NOTICE:  EMI: Using DDR unknown settings
NOTICE:  EMI: Detected DRAM size: 4096 MB
NOTICE:  EMI: complex R/W mem test passed
NOTICE:  LVTS: Enable thermal HW reset
NOTICE:  Located partition 'fip' at 0x680000, size 0x400000
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)

thanks!

all these images are loaded in the sdcard - using the uboot menu you can choose an option to copy the files to the nand, and then from the nand to the emmc

if you want to change the default images names you need to change the uboot env variables or otherwise look at the package uboot-mediatek there will be patches (450-add-bpi-r4.patch) there that set the env variables for each device

Openwrt uses fip (uboot+bl3) in ubi…so you have to create an ubifs,add a partition names “fip” and then flash the fip image there