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

meanwile i finaly buld also the kernel as bruce mentionned and followed the compleet procedur ehe withe on this forum.

and my source conf is : skipubootdownload=1 skipkerneldownload=1 replacebl2=1 bl2file=bpi-r4_emmc_8GB_bl2.img imgfile=bpi-r4_emmc.img.gz kernelfile=bpi-r4_6.17.0-main.tar.gz userpackages=“docker.io docker-compose cockpit network-manager wireguard qemu-system-aarch64 libvirt-daemon-system virtinst bridge-utils apparmor apparmor-utils”

it my terminal just finish tu build here ise the last line

:warning: /proc/ is not mounted. This is not a supported mode of operation. Please fix your invocation environment to mount /proc/ and /sys/ properly. Proceeding anyway. Your mileage may vary. packing bpi-r4_noble_6.17.0-main_sdmmc.img.gz install it this way: gunzip -c bpi-r4_noble_6.17.0-main_sdmmc.img.gz | sudo dd bs=1M status=progress conv=notrunc,fsync of=/dev/sdX

i use the script for a emmc boot , and what i see the final image name is sdmmc?? so i will try to copy to a sd and boot from sd if word il will continue to follow the procedure and flash the emmc with this image

Emmc has bl2 on boot0…it is not part of the image. Image building script does not support emmc (only by using emmc image previously downloaded),so target filename is always sdmmc atm.

finaly this config you just added : option to replace bl2 when creating image. but file must be downloaded manually at the moment.

replacebl2=1
bl2file=bpi-r4_sdmmc_8GB_bl2.img

in sourcefiles_bpi-r4.conf

is valide if you i use your scritp (BPI-Router-Image without bulding before the kernel and the boot manualy? So if i use the today bruce post (full build procedure), i dont need this conf and local file before ? right

Why compile uboot and kernel? If you do not change config you can use precompiled files.

For bl2 replace you have to use the new option or you run “build.sh createimg” after building uboot with 8gb atf. But i think the new option is easier than building all manually.

Yes, since BPI-R3 eMMC is allowed to do so, I was doing the same thing to BPI-R4 eMMC.

I’ll collect the crash log when I back to office.

You cannot overwrite the storage with an image when you working on it it is a very bad idea…

As i said emmc bl2 has to be written to boot0. Only sdmmc is partition 1. So it makes no sense replace the bl2 in the emmc image.

According to @Myrko feedback, not adding skipubootdownload=1 and skipkerneldownload=1 to sourcefiles_bpi-r4.conf that the build script will download the unexpected released files (e.g. kernel 6.12.51 and uboot unknown version + sdmmc device by default).

Therefore, to add both skip*download=1 options that would ensure the build script to use the designated uboot and kernel. Base on this, users may build them manually, or just download the released files from those Github release pages. After collecting the files to the Images repo workspace, run the one-line build command.

If the target device is sdmmc not emmc, I think the manual build should become:

  1. U-boot
git checkout -f 2025-10-bpi
echo -e "board=bpi-r4\ndevice=sdmmc" > build.conf
./build.sh importconfig
./build.sh config               # Optional: make menuconfig
./build.sh
./build.sh rename
git checkout -f mtk-atf-2025
echo -e "board=bpi-r4\ndevice=sdmmc" > build.conf
echo -e "extraflags=DDR4_4BG_MODE=1" >> build.conf
./build.sh
./build.sh rename
./build.sh createimg non-interactive
rm build.conf

It should output bpi-r4_sdmmc.img.gz and some bl2 fip files in 8GB mode.

Since that the u-boot is already packed in DDR4 8GB mode, you may not need to assign the replacebl2 and bl2file settings in the later sourcefiles_bpi-r4.conf.

  1. Linux kernel

Same as above:

echo "board=bpi-r4" > build.conf 
./build.sh importconfig
./build.sh config               # Optional: make menuconfig
./build.sh build
./build.sh pack

Output bpi-r4_6.17.0-main.tar.gz

  1. Ubuntu Noble

Create sourcefiles_bpi-r4.conf:

ubuntu@afe0fd51a26a:~/BPI-Router-Images$ cat sourcefiles_bpi-r4.conf 
skipubootdownload=1
skipkerneldownload=1
imgfile=bpi-r4_sdmmc.img.gz              # Now the uboot pack should be built in 8GB mode
kernelfile=bpi-r4_6.17.0-main.tar.gz
userpackages="ethtool iperf3 tcpdump"    # Append more packages from what the "apt install" supported
ubuntu@afe0fd51a26a:~/BPI-Router-Images$

Run:

./buildimg.sh bpi-r4 noble

Output should still be named bpi-r4_noble_6.17.0-main_sdmmc.img.gz as same as I build the u-boot for emmc.

Yes I update the bl2 file to /dev/mmcblk0boot0 in kernel if needed. Or from uboot is okay through your command “run wremmc”.

And yea, overwriting the /dev/mmcblk0 from eMMC boot is worked in BPI-R3 but BPI-R4. Some other platforms, e.g. Qualcomm emmc device, allow to do so.

what’s the reason for 8gb not being detected in the first place? why does bl2 need updating? is openwrt limited? for anything other than x86? just curious

The 8gb variant uses different dram chips which need special mode in ATF to work.there is no known way of auto-detection and dram configuration is closed source (there is a dram.o binary blob in mtk atf source).

It is not openwrt fault. It is ATF limitation.

1 Like

Hi guys, I have a bpi-r4 8gb ram version, and I want to upgrade the emmc to 256gb after found video from liu_jie.

Have anyone upgraded to 256gb? Do you know which emmc chip compatibility with bpi-r4 board?