SD Card not Detecting

Hi

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

Thanks

I have the same problem, did you solve it ?

No buddy and there is no support from @sinovoip also

–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

https://github.com/BPI-SINOVOIP/BPI-M2U-bsp/blob/420a1ad51515d63306df465b05f91c32b4711528/BPI-M2Ultra_Compiler_SOP.pdf

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

  1. Copy a working sd card image to eMMC I used a USB card reader, then dd image to the eMMC

  2. mount eMMC FAT32 p1 boot partition mount -t vfat /dev/mmcblk{your eMMC} /mnt -o uid=0,gid=0,utf8,dmask=027,fmask=137

  3. modify the uEnv.txt on the boot partition of eMMC nano /mnt/bananapi/bpi-m4/linux/uEnv.txt

    1. change root to “=/dev/mmcblk{your eMMC}p2”
    2. remove "sdmmc_on=${sdmmc_on} ${bootopts} " from the line with “abootargs” variable Save and umount /dev/mmcblk{your eMMC}
  4. 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)

    1. change root to “=/dev/mmcblk{your eMMC}p2”
    2. remove "sdmmc_on=${sdmmc_on} ${bootopts} " from the line with “abootargs” variable
  5. reboot

I used the ttys0 to monitor the boot activity.

Now, you can boot with

  1. eMMC only.
  2. eMMC and SDcard inserted ONLY if sdcard with rootfs pointing to eMMC
  3. 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.

how to run: support_emmc_bootup_with_sd_storage.patch ? thanks

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.

Below the lowest lines of the Banana Pi output. All the rest is in the attached file:

*** 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 ====                                                                                                                                                                                                0 
Interface:  SD
  Device 0: Vendor: Man 035344 Snr 13233dde Rev: 8.0 Prod: SL16G
            Type: Removable Hard Disk
            Capacity: 15193.5 MB = 14.8 GB (31116288 x 512)
Filesystem: FAT16 "BPI-BOOT   "
Boot from sd
reading bananapi/bpi-m4/linux/uEnv.txt
1911 bytes read in 7 ms (266.6 KiB/s)
Loaded environment from uEnv.txt
Banana Pi bpi-m4 chip: RTD1395 Service: linux
reading bananapi/bpi-m4/linux/rtd-1395-bananapi-m4-2GB.dtb
rtk_sdmmc_cpu_wait: opcode=18 timeout waiting for SD_TRANSFER (d) to clear
Error reading cluster
** Unable to read file bananapi/bpi-m4/linux/rtd-1395-bananapi-m4-2GB.dtb **
** No partition table - mmc 0 **
*No partition table, try part 0 again!
*** Unrecognized filesystem type **
Start Boot Setup ... 
[Info] convert some env variable to fdt:factory node
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Wrong Image Format for do_booti command
ERROR: can't get kernel image!
Not raw Image, Starting Decompress Image.gz...


Error: Bad gzipped data
Decompress FAIL!!
ERROR do_booti failed!
Start Boot Setup ... 
[Info] convert some env variable to fdt:factory node
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Wrong Image Format for do_booti command
ERROR: can't get kernel image!
Not raw Image, Starting Decompress Image.gz...


Error: Bad gzipped data
Decompress FAIL!!
ERROR do_booti failed!
Start Boot Setup ... 
[Info] convert some env variable to fdt:factory node
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Wrong Image Format for do_booti command
ERROR: can't get kernel image!
Not raw Image, Starting Decompress Image.gz...


Error: Bad gzipped data
Decompress FAIL!!
ERROR do_booti failed!
Start Boot Setup ... 
[Info] convert some env variable to fdt:factory node
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Wrong Image Format for do_booti command
ERROR: can't get kernel image!
Not raw Image, Starting Decompress Image.gz...


Error: Bad gzipped data
Decompress FAIL!!
ERROR do_booti failed!
Enter console mode, disable watchdog ...

BPI-M4> new file (8.0 KB)

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.