BPI-R64: Cannot burn image to eMMC

I have an R64 and I cannot seem to be able to boot any image from the eMMC. I have tried with Debian Buster and Ubuntu - the images provided by BPI. Here is the console output:

Debian Buster with Armbian Linux ttyS0 

bpi-iot-ros-ai login: pi
Password: 
Last login: Fri Aug  2 06:49:20 UTC 2019 on ttyS0
 ____                                  ____  _ 
| __ )  __ _ _ __   __ _ _ __   __ _  |  _ \(_)
|  _ \ / _` | '_ \ / _` | '_ \ / _` | | |_) | |
| |_) | (_| | | | | (_| | | | | (_| | |  __/| |
|____/ \__,_|_| |_|\__,_|_| |_|\__,_| |_|   |_|
                                               
Welcome to Debian Buster with Armbian Linux 4.19.49-BPI-R64-Kernel
System load:   0.00 0.03 0.04   Up time:       12 min
Memory usage:  7 % of 993MB     IP:            
Usage of /:    33% of 6.7G   

[ General system configuration (beta): armbian-config ]


pi@bpi-iot-ros-ai:~$ sudo mount ^C
pi@bpi-iot-ros-ai:~$ sudo /sbin/fdisk -l
[sudo] password for pi: 
Sorry, try again.
[sudo] password for pi: 
Disk /dev/mmcblk0: 7.3 GiB, 7818182656 bytes, 15269888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe43da9c5

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1      204800   729087   524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      729088 14940159 14211072  6.8G 83 Linux


Disk **/dev/mmcblk1: 14.5 GiB**, 15552479232 bytes, 30375936 sectors  <<---- 16GB MicroSD card
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe43da9c5

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk1p1      204800   729087   524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk1p2      729088 14940159 14211072  6.8G 83 Linux


Disk /dev/sda: 7.5 GiB, 8015314944 bytes, 15654912 sectors
Disk model: USB DISK 2.0    
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x05c5b54b

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1        2048 15654911 15652864  7.5G 83 Linux


Disk /dev/zram0: 50 MiB, 52428800 bytes, 12800 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram1: 497 MiB, 521072640 bytes, 127215 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
pi@bpi-iot-ros-ai:~$ **sudo mount /dev/sda /media/** <<--- USB Stick
mount: /media: wrong fs type, bad option, bad superblock on /dev/sda, missing codepage or helper program, or other error.
pi@bpi-iot-ros-ai:~$ sudo mount /dev/sda1 /media 
pi@bpi-iot-ros-ai:~$ cd media
-bash: cd: media: No such file or directory
pi@bpi-iot-ros-ai:~$ cd /media/           
pi@bpi-iot-ros-ai:/media$ ls
2019-08-23-ubuntu-16.04-lite-preview-bpi-r64-sd-emmc.img  lost+found
-r64-sd-emmc.img /dev/mmcblk0o bpi-copy 2019-08-23-ubuntu-16.04-lite-preview-bpi-
SRC=2019-08-23-ubuntu-16.04-lite-preview-bpi-r64-sd-emmc.img
DST=/dev/**mmcblk0** <<------ eMMC
COPYMODE=imagetodisk
imagetodisk
bpi-copy(v1.3.3(github)), bananapi image & disk tools

Usage: bpi-copy [OPTIONS]...
       bpi-copy [ --help | -v | --version ]
       bpi-copy IMGFILE
       bpi-copy IMGDIR
       bpi-copy IMGFILE DEVICE
       bpi-copy DEVICE IMGFILE

Warning: Try to write 2019-08-23-ubuntu-16.04-lite-preview-bpi-r64-sd-emmc.img to BOOTDISK /dev/mmcblk0
==============================================================
Fri Aug  2 07:05:42 UTC 2019
*** start COPY (blue led on ) .....
INFO: /dev/mmcblk0 : SD/eMMC !!
umount device: /dev/mmcblk0
==============================================================
IMGFILE=2019-08-23-ubuntu-16.04-lite-preview-bpi-r64-sd-emmc.img
==============================================================
img
7.12GiB 0:05:43 [21.3MiB/s] [                                         <=>      ]
729+1 records in
729+1 records out
7650410496 bytes (7.7 GB, 7.1 GiB) copied, 343.192 s, 22.3 MB/s
0+100813 records in
0+100813 records out
***  end  COPY (blue led off) .....
Fri Aug  2 07:11:28 UTC 2019
==============================================================
RUNTIME 5:46
OK!! You can remove the BOOTDISK /dev/mmcblk0 now!!
pi@bpi-iot-ros-ai:/media$ 


After a clean shutdown and plugging the power back on I get

    F0: 102B 0000
    F6: 3800 00A0
    F3: 4000 0036
    F5: 480A 0031
    F5: 480A 0031
    00: 1005 0000
    F6: 3800 00A0
    F3: 4000 0036
    F5: 480A 0031
    F5: 480A 0031
    01: 102A 0001
    02: 1005 0000
    BP: 0000 00C0 [0001]
    T0: 0000 0365 [000F]
    System halt!

This happens after every image burn. :frowning: I cannot figure what am I doing wrong. Also tried with dd…

I guess you miss preloader at boot0-block

But currently we are working on emmc…imho no image is available with emmc-support (except the singleimage openwrt we try to modify to use emmc-boot information for other images). Can you please stay on sdcard now till we got emmc working?

I understand. Thank you for your answer.

Still, I find it weird that pendind eMMC support is not mentioned here. On the contrary - there are instructions for it. :frowning:

Also - booting from MicroSD gives me a read-only system for some reason…

Ah,ok,did not know that an image with emmc-support exists…imho our steps with the single image were the first one…but i see no preloader burned…maybe this is done by bpi-copy

Have you tried this ubuntu sd-emmc-image? I think armbian or any other is not ready for emmc

I tried with the Ubuntu image and the Debian Buster image. Followed the tutorial step-by-step.

I’m dumb. Forgot about the boot select switch (facepalm). Will try again.

Still nothing. Tried bpi-copy several times. Tried switching the physical boot switch above to 0 and 1 and back. Tried bpi-copy with /dev/mmcblk0 as a specific target.

I see both mmcblk0 (eMMC) and mmcblk1 (MicroSD) have the same identifier data:

Disklabel type: dos
Disk identifier: 0xe43da9c5

It simply won’t boot from eMMC. Any ideas? The images is written on the eMMC but if I pull out the MicroSD card it will not boot for the love of it. Same error every time:

F0: 102B 0000
F5: 480A 0031
F5: 480A 0031
F3: 4000 0036
F2: 300C 0000
00: 1005 0000
F5: 480A 0031
F5: 480A 0031
F3: 4000 0036
F2: 300C 0000
01: 102A 0001
02: 1005 0000
BP: 0000 00C0 [0001]
T0: 0000 035F [000F]
System halt!

I’m at a loss. It even boots the MicroSD as a Read-Only filesystem. :no_mouth:

I still think you need to flash preloader to boot0-partition. Maybe the same as we used in the emmc-thread Bpi-r64 quick start (boot from eMMC)

But you can look first if anything (flashed by bpicopy) is on boot0 by dd the content of it to a file

I’ve been struggling for hours and hours. How exactly do I flash the preloader to boot0-partition? I tried setting up a TFTP server. Could you guide me step by step? Pretend I know nothing about TFTP.

You don’t need tftp…only a linux booted from sd

https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:storage#install_os_on_emmc

Tried:

root@bpi-iot-ros-ai:~# mount /dev/sda1 /media                                   
root@bpi-iot-ros-ai:~# ls /media                                                
lost+found  preloader_emmc.bin                                                  
k=768bpi-iot-ros-ai:~# dd of=/dev/mmcblk0 if=/media/preloader_emmc.bin bs=1k se 
139+1 records in                                                                
139+1 records out                                                               
142848 bytes (143 kB, 140 KiB) copied, 0.0232657 s, 6.1 MB/s                    
root@bpi-iot-ros-ai:~# umount /media                                            
root@bpi-iot-ros-ai:~# halt      

and

root@bpi-iot-ros-ai:~# echo 0 > /sys/block/mmcblk0boot0/force_ro                
root@bpi-iot-ros-ai:~# mount /dev/sda1 /media                                   
root@bpi-iot-ros-ai:~# ls /media                                                
lost+found  preloader_emmc.bin                                                  
024 seek=0ot-ros-ai:~# dd if=/media/preloader_emmc.bin of=/dev/mmcblk0boot0 bs= 
139+1 records in                                                                
139+1 records out                                                               
142848 bytes (143 kB, 140 KiB) copied, 0.0223415 s, 6.4 MB/s 

Still the same error when I try booting without MicroSD:

F0: 102B 0000                                                                   
F6: 3800 00A0                                                                   
F3: 4000 0036                                                                   
F5: 480A 0031                                                                   
F5: 480A 0031                                                                   
00: 1005 0000                                                                   
F6: 3800 00A0                                                                   
F3: 4000 0036                                                                   
F5: 480A 0031                                                                   
F5: 480A 0031                                                                   
01: 102A 0001                                                                   
02: 1005 0000                                                                   
BP: 0000 00C0 [0001]                                                            
T0: 0000 0365 [000F]                                                            
System halt!

You have used r64-preloader? My manual is for r2,but way is the same only different preloaderfile

I’ve used the preloader from here. It was the only one I could find. Is there another?

I alao only know this one…seems we need some help from @sinovoip or @jackzeng about emmc-install

Else waiting till we got a bootable emmc-image with the preloader above…i’m able to boot own uboot from emmc and created partitions for boot/rootfs…due to less time i’m not further yet

How did you manage to boot your own uboot from emmc? Is it for me to understand you got this working somehow on your own R64?

Compiled u-boot from here with option #2 (u-boot only) then

# dd if=/media/u-boot.bin of=/dev/mmcblk0boot0 bs=1024 seek=0

even

# dd if=/media/u-boot-mtk.bin of=/dev/mmcblk0boot0 bs=1024 seek=0

or

# bpi-bootsel /media/u-boot.bin /dev/mmcblk0

or

# bpi-bootsel /media/preloader_emmc.bin /dev/mmcblk0

still the same error:

F0: 102B 0000                                                                   
F6: 3800 00A0                                                                   
F3: 4000 0036                                                                   
F5: 480A 0031                                                                   
F5: 480A 0031                                                                   
00: 1005 0000                                                                   
F6: 3800 00A0                                                                   
F3: 4000 0036                                                                   
F5: 480A 0031                                                                   
F5: 480A 0031                                                                   
01: 102A 0001                                                                   
02: 1005 0000                                                                   
BP: 0000 00C0 [0001]                                                            
T0: 0000 0365 [000F]                                                            
System halt!

only preloader has to be flashed to boot0…uboot needs to be written at 768k offset on main hw-partition /dev/mmcblkx

You could try my file from here (offset 0 on mmcblkx): Bpi-r64 quick start (boot from eMMC) but maybe its not compatible with the images…you maybe need to reformat bpi-boot/root and add your files and configure uboot to load kernel

Preloader seems to bound to gpt…i guess the other images have only mbr-partitiontable