Boot Ubuntu from emmc/SSD

ok so i need to flash the same image two times to the mmc? What should i put in as “targetdevice” for the second “dd”?

During partition-configuration: https://wiki.fw-web.de/doku.php?id=en:bpi-r2:uboot#change_partition-configuration_of_emmc i noticed that the “emmc” commands are not working - so i used “mmc” commands instead - is that also ok? I did the partition-configuration in uBoot - is that correct?

I tried it again, and it’s booting from MMC. But now i get this error during bootup:

[MEM] complex R/W mem test pass
0:dram_rank_size:80000000
[Dram_Buffer] dram size:-2147483648
[Dram_Buffer] structure size: 1725560
[Dram_Buffer] MAX_TEE_DRAM_SIZE: 0
Load u-boot from eMMC...
[PLFM] Init Boot Device: OK(0)

[PART] blksz: 512B
[PART] [0x0000000000000000-0x000000000003FFFF] "PRELOADER" (512 blocks)
[PART] [0x0000000000000000-0x000000000003FFFF] "MBR" (512 blocks)
[PART] [0x0000000000040000-0x00000000000BFFFF] "UBOOT" (1024 blocks)
[PART] [0x00000000000C0000-0x00000000000FFFFF] "CONFIG" (512 blocks)
[PART] [0x0000000000100000-0x000000000013FFFF] "FACTORY" (512 blocks)
[PART] [0x0000000000140000-0x000000000213FFFF] "BOOTIMG" (65536 blocks)
[PART] [0x0000000002140000-0x000000000413FFFF] "RECOVERY" (65536 blocks)
[PART] [0x0000000004140000-0x000000004413FFFF] "ROOTFS" (2097152 blocks)
[PART] [0x0000000044140000-0x000001FFC413FFFF] "USER" (-4194304 blocks)
[platform_vusb_on] PASS
[TOOL] PMIC not dectect usb cable!
[TOOL] <UART> listen  ended, receive size:0!
[TOOL] <UART> wait sync time 150ms->5ms
[TOOL] <UART> receieved data: ()

Device APC domain init setup:

 bootloader load uboot ,the address of uboot is 81E00000
[PART]partition name UBOOT
[PART]partition start block 0x200
[PART]partition size 0x80000
[PART]partition blks 0x400
[PART]partition flags 0x0
[PART]partition name 0x8
[bean] part->startblk(0x200) bdev->blksz(0x200) part->part_id(8) hdr(0xFFB50000)
[BlkDev.c 101 ]partition block size 0x200 ,blks:0xE90000
[BlkDev.c 101 ]partition block erase size 0x200

[PART] load "UBOOT" from 0x0000000000050000 (dev) to 0x81E00000 (mem) [SUCCESS]
[PART] load speed: 10462KB/s, 300000 bytes, 28ms
[BT_SD_PG] device info 0x8590 0x8A00 0xCB01 0x102
0:dram_rank_size:80000000
[PLFM] md_type[0] = 16
[PLFM] md_type[1] = 136

[PLFM] boot reason: 0
[PLFM] boot mode: 0
[PLFM] META COM0: 0
[PLFM] <0xFFB7CC10>: 0x0
[PLFM] boot time: 2012ms
[PLFM] DDR reserve mode: enable = 0, success = 0

[BLDR] jump to 0x81E00000
[BLDR] <0x81E00000>=0xEA0000B8
[BLDR] <0x81E00004>=0xE59FF014
No valid device tree binary found at 81e62d64
initcall sequence 81e39690 failed at call 81e32c39 (err=-1)
### ERROR ### Please RESET the board ###

emmc was in older uboot,in newer it is mmc…it is right,so you’ve booted.

You have r2 right? Afair uboot is same binary so i wonder why it does not find devicetree which is part of the binary.

Have you used the emmc preloader (boot0)? This is different to sdcard

Yes it’s a R2

i used this preloader from the manual: https://github.com/BPI-SINOVOIP/BPI-files/blob/master/SD/100MB/BPI-R2-EMMC-boot0-DDR1600-0k-0905.img.gz

anything else i can check?

please try one of the last 2

e.g. this:

https://github.com/BPI-SINOVOIP/BPI-files/blob/master/SD/100MB/BPI-R2-EMMC-boot0-DDR1600-20191024-0k.img.gz

early preloader does not allow larger uboot binary, i do not remember the error appearing there, but current uboot for r2 contains usb and sata and so it will be larger than on first days when i’ve wrote the manual

Thanks for your help Frank! Now it is working.

one last thing: when i booted from SD, i needed to press the power-on button for more than 10 seconds. Now i just need to press it for 2-3 Seconds. Is there any reason why SD needs so long?

And is it possible to bridge the power on button? So that it will autostart like a raspberry pi? I read somewhere else, that this can cause other issues.

this is a hardware-limitation, that boards needs power for more than 10 seconds to keep on. you can bridge it or add additional power on otg port. but for first you need to make sure that you do not have mtk-pmic-keys active as they look if powerbutton is pressed and then trigger reboot/poweroff