Replace factory default bootloader - R4

Hi, I want to replace the factory default NAND bootloader with the OpenWRT version. I can’t seem to turn up any posts or documentation on this. I have the files listed below all set.

openwrt-25.12.3-c3b221cfe4e9-mediatek-filogic-bananapi_bpi-r4-snand-preloader.bin
openwrt-25.12.3-c3b221cfe4e9-mediatek-filogic-bananapi_bpi-r4-snand-bl31-uboot.fip

Is it accomplished in the top level uboot menu somehow?

*** U-Boot Boot Menu ***

      1. Startup system (Default)
      2. Upgrade firmware
      3. Upgrade ATF BL2
      4. Upgrade ATF FIP
      5.   Upgrade ATF BL31 only
      6.   Upgrade bootloader only
      7. Upgrade single image
      8. Load image
      9. Start Web failsafe
      0. U-Boot console

Or maybe sf command in the console? (Side question: Can anyone let me know how I exit the U-Boot console ?)

I can’t seem to boot from USB (dip switches down… A=B=1). I get a SYSTEM HALT! message in picocom.

Unsure how to proceed.

You have to boot mainline openwrt from sdcard and install from its uboot to nand

What do you mean with exit uboot console? Going “back” to the menu? Just type “bootmenu”…but uboot console is the lower level…you can use “reset” to reboot the board or (as uboot runs in RAM) just power off the board

You can only direct booting from mmc or spi. USB and nvme can be only booted from uboot.

You have ti boot mainline openwrt from sdcard and install from its uboot to nand

Yes, this is what I want to do. Also good to know the using the sd card is the only way to accomplish my goal. This is the problem though. I’m doing something wrong.

  1. I build the sdcard image from the openwrt firmware builder (openwrt-25.12.3-c3b221cfe4e9-mediatek-filogic-banana pi_bpi-r4-sdcard.img in my case)
  2. set the switches and enter a picocom shell
  3. boot the device from the sdcard …

This is where I get the ‘system halt’ problem.

What do you mean with exit uboot console? Going “back” to the menu? Just type “bootmenu”…but uboot console is the lower level…you can use “reset” to reboot the board or (as uboot runs in RAM) just power off the board

Thanks, the mtkautoboot was the command I was looking for.

You can only direct booting from mmc or spi. USB and nvme can be only booted from uboot.

This is helpful to know.

FYI this post might explain my situation. At the end the poster was able to install the openwrt bootloader which is my goal.

Normally the sdcard image is packed (.img.gz),you have to unpack first and write to card…be sure all data is written to card by using sync or similar…

I’ve only used the unzipped image.

I haven’t been using sudo sync. I did this time,

sudo dd if=openwrt-25.12.3-c3b221cfe4e9-mediatek-filogic-bananapi_bpi-r4-sdcard.img bs=1M conv=fsync status=progress of=/dev/sda1
sudo sync

Booting this image I still get,

F0: 102B 0000
FA: 1042 0000
FA: 1042 0000 [0200]
F9: 1041 0000
F3: 1001 0000 [0200]
F3: 1001 0000
F6: 380E 5800
F5: 4801 0000
00: 1005 0000
FA: 1042 0000
FA: 1042 0000 [0200]
F9: 1041 0000
F3: 1001 0000 [0200]
F3: 1001 0000
F6: 380E 5800
01: 102A 0001
02: 1005 0000
BP: 0200 00C0 [0001]
EC: 0000 0000 [3000]
MK: 0000 0000 [0000]
T0: 0000 01C6 [0101]
System halt!

All dipswitches down (A=B=1).

You have to write image to sda,not first partition…

That was it. Had to be something basic :relieved:. Thanks so much!

       ( ( ( OpenWrt ) ) )  [SD card]       U-Boot 2025.10-OpenWrt-r32912-6639b15f62 (May 04 2
      1. Run default boot command.
      2. Boot system via TFTP.
      3. Boot production system from SD card.
      4. Boot recovery system from SD card.
      5. Load production system via TFTP then write to SD card.
      6. Load recovery system via TFTP then write to SD card.
      7. Install bootloader, recovery and production to NAND.
      8. Reboot.
      9. Reset all settings to factory defaults.
      0. Exit


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