I installed ubuntu mate on SD card and after that installed the OS to emmc through USB drive through DD, and formatted the SD Card.
Now i am able to boot from emmc, but if sd card is installed then it doesn’t boot, and if i boot and then insert the SD card it is not showing in fdisk
What is the procedure to enable the sd card because after installing ubuntu mate only 400MB space is remaining and need to store the video files for operation
–edited – M4 uses mainline U-boot and device tree and does NOT use .fex
– see reply below for my approach–
I noted the approach in the link below but haven’t had the time to get it to work.
I believe the solution involves editing the sys_config.fex file to use eMMC as rootfs and the sdcard as typical storage. I’m yet to come across details of the options available in sys_config.fex but here are the instructions to re-compile the uboot
Finally got to this.
Having a TTL-usb cable helps ALOT!
I got M4 to boot from eMMC with an SD card inserted. with rootfs located on eMMC.
Everything done with su
Copy a working sd card image to eMMC
I used a USB card reader, then dd image to the eMMC
mount eMMC FAT32 p1 boot partition
mount -t vfat /dev/mmcblk{your eMMC} /mnt -o uid=0,gid=0,utf8,dmask=027,fmask=137
modify the uEnv.txt on the boot partition of eMMC
nano /mnt/bananapi/bpi-m4/linux/uEnv.txt
change root to “=/dev/mmcblk{your eMMC}p2”
remove "sdmmc_on=${sdmmc_on} ${bootopts} " from the line with “abootargs” variable
Save and umount /dev/mmcblk{your eMMC}
mount SDcard FAT32 p1 boot partition
e.g mount -t vfat /dev/mmcblk{your SDcard} /mnt -o uid=0,gid=0,utf8,dmask=027,fmask=137
nano /mnt/bananapi/bpi-m4/linux/uEnv.txt
(modifing the uEnv.txt on the boot partition of SDcard)
change root to “=/dev/mmcblk{your eMMC}p2”
remove "sdmmc_on=${sdmmc_on} ${bootopts} " from the line with “abootargs” variable
reboot
I used the ttys0 to monitor the boot activity.
Now, you can boot with
eMMC only.
eMMC and SDcard inserted ONLY if sdcard with rootfs pointing to eMMC
SDcard if rootfs pointing to SDcard - for recovery mode
Apply this patch support_emmc_bootup_with_sd_storage.patch (4.1 KB) if you want boot from emmc only and use sdcard as storage. Make sure your sdcard is format without bootable files.
Hello Guys
I also bought a banana pi m4 to play with. But unfortunately I d’idnt found a way to run it correctly. The issue is always, that the SD card is not recognized correctly to boot from it.
It is 2GB version and I tried several things.
First I downloaded the 2020-05-18-ubuntu-16.04-server-bpi-m4-aarch64-sd-emmc.img.zip. The md5 checksum was correct after build to SD card with the command bpi-copy I started the BananaPi with it. The output of the serial shows that GPT seems unavailable but conversion to GPT afterwards didn’t solve it. Also an own build with the docker image was not successful. How must the data been stored in the SD card? Do I need some extra configuration after dd?
Below the output-snippet of the UART. thx a lot for your help.
SD:
SD device index# 0
mmc->scr[0]=2358003,mmc->scr[1]=0
SD: init done, no error
SD: capacity 31116288 sectors(0x1dacc00), (15193 MB)
Factory: SD
[FAC] No factory data in SD
------------can’t find tmp/factory/000BootParam.h
[ENV] read_env from factory failed
Using default environment
*** Warning - bad CRC, using default environment
[BPI] set dram dtb is 2GB
In: serial
Out: serial
Err: serial
HDMITx_HPD=False
GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
get_partition_info_efi: * ERROR: Invalid GPT *
GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
get_partition_info_efi: *** ERROR: Invalid Backup GPT ***
------------can't find tmp/factory/hdmitx_format.bin
------------can't find tmp/factory/video_rpc.bin
tv_system=25 mode=1
Net: Realtek PCIe GBE Family Controller mcfg = 0024
dev->name=r8168#0
Checking default environment
Hit Esc or Tab key to enter console mode or rescue linux: 3
------------can't find tmp/factory/recovery
------------finished reboot_action
======== Checking into android recovery ====
the log message is a part of the full console debug message, and without error infomation, please upload the log from power on to error, the gpt message can ignore.
cmd18 error when read dtb file from boot partition, was this issue occurred every time after flash image? have you try another sdcard or format this card with dd?
Which card type used? my board work well with sandisk sd-hc class 10 16GB and sandisk sd-xc class 10 64 GB.