Bpi-r64 quick start (boot from eMMC)

Openwrt with kernel 4.19 afaik does not support mt7622 wifi. Mt7615 should be in,but mt7622 was developed later,so i guess you need to include it by yourself

It’s worse than that because bootdevice ils always sd on reboot/reset for R64.

Have you set bootswitch to proper device? Btw.you can modify your sdcard uboot to always boot from emmc :slight_smile: just set device/partition where kernel gets loaded and bootargs (cmdline for linux)

Yes, I use position 0 to boot from emmc, it works when power is switched on. But reboots and resets always uses SD. In practice this means that you cannot remove SD and must have - at least - headers, preloader and u-boot flashed to it.

1 Like

Ok,it behaves a bit different to r2 where it always boots device accessed on poweron (if emmc booted first,reboot also boots emmc,also if sd is inserted). This behaviour of r64 is odd…maybe @sinovoip can explain cause…i guess it can be sd-preloader which is also in emmc bootchain

@cafebabe @kalminlee @deema can you please test the Fix-Patch for emmc-issue i’ve linked here: Add latest U-boot support for BPI R2 & BPI R64 (not yet) ?

In relese brunch set that relese was 5 days ago. I think it don’t contain your patch.

And can you explain how to use it with SD card (I dont want flash eMMC)? In readme you had wrote “you can also install direct to sd-card which makes a backup of kernelfile, here you have to change your uEnv.txt if you use a new filename (by default it’s containing kernelversion)”. But I don’t understand, can you write sep by step manual.

I linked directly to the patch itself https://github.com/frank-w/BPI-R2-4.14/commit/f644b6766b28c72fb6ccef5832201032808dc2ca it is only applied to 5.4-mmctest branch. But you can make same change to any other branch. Compile it and install to sdcard (both can be done via build.sh)

latest patch i got confirms my assumption

have added it to 5.4-main too (which gets compiled by travis and put to github-releases), because it will be posted to mailinglist soon

Hi, Thanks it fixes emmc linux boot for me.

But for R64 there is still reboot issue that prevents the sd to be removed.

@sinovoip Do you know why sd preloader (Build Time: 20180625-214655) is boot when the board is reset instead of emmc preloader (Build Time: 20190927-141930) in /dev/mmcblk0boot0 ? Also why is the SD preloader image necessary in /dev/mmcblk0 offset 2k ? It seems it is not even booted.

Yes this is another issue…we focused on emmc write issue because it results in data-corruption.

I guess emmc-preloader stores wrong bootdevice in memory and bootswitch is only checked on poweron

yes, I will test it in a few days

Can you build openwrt kernel 5.4 into R64 EMMC? How? I have try the patch from @frank-whttps://github.com/frank-w/BPI-R2-4.14/commit/c83b2a27dad867951fbd157b1bd0a9d9cd551f7a,Not working for me.

I have no openwrt…as far as i know there is still an mtd-problem in 5.4. I had tested mount of emmc in debian which is working with the patch you linked

@bourne_hlm have you got it working? I have also got a patch for uboot, where sometimes (not with my v1.0 board) emmc is not working

@kalminlee have you tested it?

@sinovoip have you took a look on reboot-always-to-sdcard issue?

@frank-w @bourne_hlm the OpenWRT 5.4 kernel’s mtd driver have some issue. when I assign the MTD pattion on SD card or EMMC, the kernel can’t mount the rootfs. I think that it should be one kernel’s mtd driver issue. But you may don’t use the MTD partiotn on the EMMC, you can use the standard linux partition structure, then mount the mmc0blk0p1 block device. the path can work fine.

Basicly it sounds like a generic issue because it is mtd layer which should not be mtk related, am i right? Have you any more information?

Openwrt allows to create (packed) rootfs which can be used on additional partition on my debian-image. This needs only some uboot justification to pass different rootfs-partition to kernel (if you don’t overwrite my debian rootfs)

An error occurs when building on kernel 4.19. Please tell me what could be wrong

 >    cc1: some warnings being treated as errors
> scripts/Makefile.build:303: recipe for target '/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/mt7615/main.o' failed
> make[6]: *** [/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/mt7615/main.o] Error 1
> scripts/Makefile.build:544: recipe for target '/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/mt7615' failed
> make[5]: *** [/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/mt7615] Error 2
> Makefile:1528: recipe for target '_module_/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a' failed
> make[4]: *** [_module_/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a] Error 2
> make[4]: Leaving directory '/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/linux-4.19.138'
> Makefile:392: recipe for target '/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/.built' failed
> make[3]: *** [/home/redevice/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2020-09-18-ec84891a/.built] Error 2
> make[3]: Leaving directory '/home/redevice/openwrt/package/kernel/mt76'
> time: package/kernel/mt76/compile#3.05#0.68#3.74
> package/Makefile:111: recipe for target 'package/kernel/mt76/compile' failed
> make[2]: *** [package/kernel/mt76/compile] Error 2
> make[2]: Leaving directory '/home/redevice/openwrt'
> package/Makefile:107: recipe for target '/home/redevice/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.package_compile' failed
> make[1]: *** [/home/redevice/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.package_compile] Error 2
> make[1]: Leaving directory '/home/redevice/openwrt'
> /home/redevice/openwrt/include/toplevel.mk:234: recipe for target 'world' failed
> make: *** [world] Error 2

try to build with

make -j1 V=s

and please put output in code-tags to be more readable

I tried make -j1 V=s, the output is the same as in the previous post.