[BPI-R4] Successfully upgraded 8GB RAM on BPI-R4

@frank-w

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, :frowning: 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 :slight_smile:

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.

8GB RAM:Amazon.com: youyeetoo Banana Pi BPI-R4 WiFi 7 Router Development Board, 8GB RAM, 8GB eMMC, MediaTek MT7988A Chip, 2X 10Gbe SFP Slots, 4X Gbe Ports, Metal Case (Wi-Fi 7 Paket Bulk) : Electronics

4GB RAM:Amazon.com: youyeetoo Banana Pi BPI R4 WiFi 7 Router Single Board Computer - Assembled, 4GB RAM, 8GB eMMC, MediaTek MT7988A Chip, 2X 10Gbe SFP Slots, 4X Gbe Ports, Metal Case (Wi-Fi 7 Paket Bulk) : Electronics

I solved it but only flash in emmc and it detects the 8gb of ram.

Hi there, Your 4GB image has made my ssd to work I have a 8GB RAM R4 board Can you please give me a 8G sd card version? Thanks

Hi there, Your 4GB image has made my ssd to work I have a 8GB RAM R4 board Can you please give me a 8G sd card version? Thanks

If you are using my image you just have to flash matching bl2.img (sdmmc,8gb) to the same card to partition 1 of card.

You find binaries in my uboot repo releases

https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2025-07-bpi-2025.07-2025-07-22_1719/bpi-r4_sdmmc_8GB_bl2.img

Thanks for your quick reply. I havent figured out how to flash the bl2.img. Can you explain to me how to do that? Thank you!

This ia how i do while creating my image

Important is that you flash to p1 of your target device (e.g. /dev/sdb1 if sdb is your card) and not the main device.

But which image do you use exactly? BL2 should work for all,but i have only tested on my image.

@5gfreak have you found a way to fix the ubi ec error? Possibly the nand is not completely erased before writing the ubinized image. Currently i testing my own ubinized image for nand and got same issue.

Did this way:

BPI-R4> mtd erase spi-nand0 0x200000    
Erasing 0x00200000 ... 0x101fffff (2048 eraseblock(s))

And daniel noticed that only 2048 blocks are erased. So it ahould be this:

mtd erase spi-nand0 0x200000 0x7e00000

But have not found time to test yet.

Oh I see, I only have windows 11. Which Linux distro do you have for your compilations? Any way I can update the bl2 img? Currently I’m using the latest snapshot image.

I’m not sure which windows application can flash to partition and not only to device. I use ubuntu for doing such things.you can bootup it as live system without installig…this is slow but you could do it there. Only have to figure out the right device and download the file for flashing there.

Thanks for the info. I think for now I will run it as is and wait hopefully for the further versions to have this sorted out.

You can flash the bl2.img using linux that is running on the R4 also…

This is possible,but you can brick system which will require full new install.better is backing up the current partition 1 and thrn flash to it the new data which leaves restore option.

Creating same image only with 200kb difference because of ram does not make much sense.

Indeed. Writing the 8gb bl2 should be done right after the first boot from sd, making the impact of corrupting the sd as small as possible.

Can anyone point me to a site that ships from or at least to the US that has the ram available? I’ve looked at digikey and mouser but couldn’t find the sk hynix/samsung modules that are known to work from this thread.