[bpi-r4] Debian or Ubuntu on emmc

Hello everybody!

How to install debian or ubuntu image on emmc memory? I tried to install ubuntu-24.04-server-bpi-r4-5.4-aarch64-sd-emmc.img but it won’t boot. I have shapshot OpenWrt image installed on snand.

Can I please some tutorial?

Emmc needs bl2 in boot0 block and set partconf right to boot from boot0

Basicly like r3 (and others)…

https://wiki.fw-web.de/doku.php?id=en:bpi-r3:uboot#writing_emmc

Skip the gpt part and flash your (or mine) image to userpartition. Below that is the bl2 part (3rd code block)

BPI-R3> mmc dev 0
switch to partitions #0, OK
mmc0(part 0) is current device
#switch to boot0 block
BPI-R3> mmc partconf 0 1 1 1
BPI-R3> mmc erase 0x0 0x400
BPI-R3> fatload usb 0:1 $loadaddr bl2_emmc_usb.img
200072 bytes read in 19 ms (10 MiB/s)
BPI-R3> mmc write ${loadaddr} 0x0 0x400

MMC write: dev # 0, block # 0, count 1024 ... 1024 blocks written: OK
#switch back to user-partition
BPI-R3> mmc partconf 0 1 1 0

I used your image generator @frank-w and now it works.

If someone will look how i did it:

  1. clone repo: GitHub - frank-w/BPI-Router-Images
  2. Download emmc uboot file, eg: https://github.com/frank-w/u-boot/releases/download/CI-BUILD-2024-10-bpi-2024.10-2024-11-03_0940/bpi-r4_emmc.img.gz
  3. create file sourcefiles_bpi-r4.conf:
skipubootdownload=1
imgfile=bpi-r4_emmc.img.gz
kernelfile=bpi-r4_6.9.0-main.tar.gz
  1. run command: ./buildimg.sh bpi-r4 jammy
  2. start nand image and copy to device: gunzip -c bpi-r4_jammy_6.9.0-main.img.gz | dd bs=512 conv=notrunc,fsync of=/dev/mmcblk0

That’s all.

1 Like

Thanks for report,have not yet included emmc flag in the buildimg.sh completely.

You should use newer kernel (6.11) as i recently fixed spi1 and pwm6 based on information from @dangowrt

Thanks a lot for this. Worked beautifully!

I been having a tough time getting this bpi r4 lite board to work with eMMC storage. I was going to try this but where do you source the kernel file? kernelfile=bpi-r4_6.9.0-main.tar.gz. Also this post is pretty old, so I imaging that particular kernel is not the best to use anymore?

Yes r4lite and emmc is tricky…need to run in 4bit mode because dat5 is sd cd pin,so not usable.also uhs mode and frequency needs to be adjusted…these are my current settings:

Last stable from my repo is 6.17-main (also supports r4lite and pro partially),but script takes 6.12 (last LTS) as default.

So if the SD-card is removed, then 8bits emmc could be used, right?

possibly but had not got it working…maybe because speed must be limited too.

but this r4lite discussion should be moved to dedicated thread