by the way - my offer of trying to get this upstreamed to OpenWrt still stands. I would want a smooth user experience for users of this hardware. I’ll start with the commits I can identify from your uboot repository which affects bl2 and 8G RAM; may need you to chime in later on (or with @\dangowrt) if the OpenWrt maintainers have questions
Some neat way to include this directly into openwrt build env, maybe a patch or something?
I would very much appreciate a 8G image. Not only because it would be convenient, but also less error prone for users like myself.
I wasn’t able to make it work for emmc at all, because I got a permission error (as root) for /dev/mmcblk0boot0 from NAND when i try:
dd if=bl2emmc.img of=/dev/mmcblk0boot0
I could only make it work on when booting from sdcard and the aforementioned release (2025.01) of the bl2. not sure what to do for NAND and emmc.
i also tried it with the reconstructed image using the script by @lowjoel shell. this also only worked when booting from sdcard. Flashing this to NAND seemed to work, but on boot from NAND i got “system halt”.
with the latest release of the bl2 files (Release Build for branch 2025-04-bpi (2025.04) · frank-w/u-boot · GitHub) it boots, but the memory is show as 4G not 8G.
If a dedicated image could “just” make it work that would be great. ![]()
You used bpi-r4 8g_bl2.img?
It could be possible that 2025-04 files are broken because i only rebased 2025-01 patches and cleaned up pipeline to use only mtk-atf-2025. But this atf source was also used for 8g bl2 in 2025-01 so at least this should work.
yes, bpi-r4_sdmmc_8GB_bl2.img, bpi-r4_emmc_8GB_bl2.img and bpi-r4_spim-nand_ubi_8GB_bl2.img respectively
How is debug uart output on sdmmc? The 8g bl2 should not differ to 2025-01 uboot if i have no error in pipeline,but have not noticed one.
For nand i suggest writing from uboot.
For emmc i guess you need to set partconf and maybe bootbus. And imho linux blocks write access to boot partitions (maybe set force_ro to 0). Do you see them?
Edit: seems like i have to cleanup the bl2/fip files before running atf build again
edit2: could you try the new binaries from here:
hi i just tried them. unfortunately the 8G won’t get detected even on boot from sd card. I booted into uboot from sd and selected flashed to nand (because i feelt lucky) but still booted to openwrt to check the memory which was still at 4G
sd-boot.log (92.4 KB)
Thats strange because ci pipeline looks good
Atf is built with DDR4_4BG_MODE=1 and renamed to bpi-r4_sdmmc_8GB_bl2.img afterwards. Or do you checked ram from nand boot? But your log shows sdcard boot and it looks like you have not replaced bl2 here
NOTICE: BL2: v2.12.0(release):d50bccad1-bpi-r4-sdmmc
NOTICE: BL2: Built : 11:36:00, May 25 2025
NOTICE: WDT: Cold boot
NOTICE: WDT: disabled
NOTICE: CPU: MT7988
NOTICE: EMI: Using DDR unknown settings
NOTICE: EMI: Detected DRAM size: 4096 MB
Build time is 4 days ago…you do not have to boot openwrt…you see detected ram in bl2 and uboot too.
Hi sorry for the late response come, i tried it on the weekend and got it to work after numerous attempts … ![]()
it looks like my cheap usb sdcard-reader fooled me…
i seems to make unreliable writes with dd. I will try to look for a new one…
one thing that i noticed are bad block notices. this doesn’t happen if i flash the rom linked on the bpi documentation, but this is a really old release.
The mtk sdk uses propritary nmbm for some kind of wear leveling,but mainline uboot does not,so maybe crc checks or similar are different.
I was trying your bl2 files and I no longer have internet access, opkg doesn’t work, I tried everything but nothing, I have a public IP but I don’t have internet
bl2 does not have anything to do with opkg and internet…it only makes sure all 8GB ram is detected and passed through uboot and to linux-kernel.
please post your bootlog (debug-uart) from bootrom to uboot with bootmenu skipped (to see the ram detected by uboot).
afaik openwrt use not another package manager and internet access mostly needs nat and routing setup (openwrt should do automaticly but maybe there is a configuration issue due to different wan-ports).
the last part should be in separate thread (please use existing thread if one exists).
as I am new to bpi-r4 and not so experienced I apologize for the simple question:
To clarify, which bl2 file is required to flash on BPI-R4 8GB to boot from NAND from your link?
there are 2 different BL2 8gb there: bpi-r4_spim-nand_8GB_bl2.img and bpi-r4_spim-nand_ubi_8GB_bl2.img
Only the bl2 File must be flashed? or the respective fip.bin must be flashed too?
I have the same issue when booting from NAND shows 4GB instead of 8GB because I used a snapshot image from openwrt and NAND bl2 has been overwritten.
If yor nand is empty you need fip too. For continue with openwrt you need the ubi bl2,for debian/ubuntu the non-ubi
thank you for your prompt reply, really appreciate. I will have a try when back home and let you know
It is recommended to flash it over the uboot menu? is there any way to get the original nand bl2 8gb? that was the bl2 2.11.0 version.
nice day!
From linux you can read the target and write to a file…uboot afaik can only read files.
For flashing bl2 and fip i have a variable which you can use.
E.g. (adjust filenames)
run useusb
setenv bl2file bpi-r4_bl2_spimnand_8G.img
setenv fipfile bpi-r4_fip_spimnand.bin
run wrspimnand
for emmc use different filenames and the wremmc var at the end.
@frank-w Hallo Frank,
It has been fixed after flashing your file bpi-r4_spim-nand_ubi_8GB_bl2.img The only issue now is that there are many notices on booting that: NOTICE: UBI: Bad EC magic in block 1008 ffffffff but it is booting to nand and the 8gb is now recognized.
NOTICE: BL2: v2.12.0(release):d50bccad1-bpi-r4-spim-nand NOTICE: BL2: Built : 15:56:22, May 28 2025 NOTICE: WDT: Cold boot NOTICE: WDT: disabled NOTICE: CPU: MT7988 NOTICE: EMI: DDR4 4BG mode NOTICE: EMI: Using DDR unknown settings NOTICE: EMI: Detected DRAM size: 8192 MB NOTICE: EMI: complex R/W mem test passed NOTICE: LVTS: Enable thermal HW reset NOTICE: SPI_NAND parses attributes from parameter page. NOTICE: SPI_NAND Detected ID 0xef NOTICE: Page size 2048, Block size 131072, size 268435456 NOTICE: UBI: scanning [0x200000 - 0x10000000] … NOTICE: UBI: Bad EC magic in block 1008 ffffffff NOTICE: UBI: Bad EC magic in block 1009 ffffffff NOTICE: UBI: Bad EC magic in block 1010 ffffffff NOTICE: UBI: Bad EC magic in block 1011 ffffffff NOTICE: UBI: Bad EC magic in block 1012 ffffffff NOTICE: UBI: Bad EC magic in block 1013 ffffffff NOTICE: UBI: Bad EC magic in block 1014 ffffffff NOTICE: UBI: Bad EC magic in block 1015 ffffffff NOTICE: UBI: Bad EC magic in block 1016 ffffffff
NOTICE: UBI: Bad EC magic in block 2029 ffffffff NOTICE: UBI: Bad EC magic in block 2030 ffffffff NOTICE: UBI: Bad VID magic in block 2031 4e4d4d30 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 NOTICE: UBI: Volume fip (Id #0) size is 2097152 bytes NOTICE: BL2: Booting BL31 NOTICE: BL31: v2.10.0 (release):OpenWrt v2024.01.17~bacca82a-3 (mt7988-spim-nand-ubi-comb) NOTICE: BL31: Built : 23:09:37, Feb 3 2025
U-Boot 2024.10-OpenWrt-r28427-6df0e3d02a (Feb 03 2025 - 23:09:37 +0000)
CPU: MediaTek MT7988 Model: Bananapi BPI-R4 DRAM: 8 GiB Core: 64 devices, 23 uclasses, devicetree: embed spi-nand: spi_nand spi_nand@0: Winbond SPI NAND was found. spi-nand: spi_nand spi_nand@0: 256 MiB, block size: 128 KiB, page size: 2048, OOB size: 128 MMC: mmc@11230000: 0 Loading Environment from UBI… Read 126976 bytes from volume ubootenv to 00000000ff7c1c00 Read 126976 bytes from volume ubootenv2 to 00000000ff7e0c40 OK In: serial@11000000 Out: serial@11000000 Err: serial@11000000 reset button found Loading Environment from UBI… UBI partition ‘ubi’ already selected Read 126976 bytes from volume ubootenv to 00000000ff7c1c00 Read 126976 bytes from volume ubootenv2 to 00000000ff7e0c40 OK Net: eth0: ethernet@15100000
( ( ( OpenWrt ) ) ) [SPI-NAND] U-Boot 2024.10-OpenWrt-r28427-6df0e3d02a (Feb 03 2025 - 23:09:37 +0000)
1. Run default boot command.
2. Boot system via TFTP.
3. Boot production system from NAND.
4. Boot recovery system from NAND.
5. Load production system via TFTP then write to NAND.
6. Load recovery system via TFTP then write to NAND.
7. Load BL31+U-Boot FIP via TFTP then write to NAND.
8. Load BL2 preloader via TFTP then write to NAND.
9. Install bootloader, recovery and production to eMMC.
a. Reboot.
b. Reset all settings to factory defaults.
0. Exit
I have only flashed the bpi-r4_spim-nand_ubi_8GB_bl2.img because I don’t know what you mean if fip is empty or not,
how can I see that? I am a novice on those things…
should I proceed flashing the fip as well with the fip file?
Thanks again ![]()
Fip is uboot packed into bl31…so when you see uboot (the openwrt menu above) you have a fip installed
Our store offers the official 8GB RAM WiFi 7 kit for $244 and the 4GB RAM WiFi 7 kit for $216. Stock is limited, so hurry and place your order through the link below.