Issues Booting from SD card

Colibri iMX6ULL 512MB IT
Viola Carrier Board
BPS 5 LST Minimal Reference Image 5.7.2

Following this guide https://developer.toradex.com/easy-installer/alternative-approaches/boot-from-an-sd-card-usb-stick-sata-drive/

I have flashed an OS to an SD card. After I insert it into the carrier board and enter U-boot I run this command

“mmc dev 1; mmc part”

I then get a message saying there is no device in mmc slot 1.

I have also verified that the sdboot command doesn’t exist in a few versions of U-boot I have tried.

So my question is “Is it possible to boot from an SD card on the iMX6ull module? If so do you have any advice as to what I am doing wrong?”

Hey @Mine1252,

When the SD card is connected to a host computer can you see what SD partitions on on the drive? via lsblk command. Also what format are these SD partitions? Can you verify.
Have you correctly mounted the boot(fat32) and rootfs(ext4) to the correct partitions?

-Eric

Sorry for the wait.
By using lsblk I can verify following:

  • partition 1 500 MB boot FAT32
  • partition 2 4 GB rootfs ext4

Hey @Mine1252,

Would you mind reporting the Uboot output of mmc dev and mmc list. This will let us know what devices are recognized via Uboot.

Also, Can you try a different SD card if possible?

-Eric

Hello @eric.tx,

Here is the output for those commands for the SD card with the SD card mentioned:

Colibri iMX6ULL # mmc dev
switch to partitions #0, OK
mmc0 is current device

Colibri iMX6ULL # mmc list
FSL_SDHC: 0 (SD)

Here is the output for those commands for another SD card with no image flashed:

Colibri iMX6ULL # mmc dev
switch to partitions #0, OK
mmc0 is current device

Colibri iMX6ULL # mmc list
FSL_SDHC: 0 (SD)

Here is the output for those commands with no SD card:

Colibri iMX6ULL # mmc dev
MMC: no card present

Colibri iMX6ULL # mmc list
FSL_SDHC: 0

Thanks for the help.

-mine1252

Of course no device in slot 1. You have it in slot 0:

So try “mmc info” and/or “mmc dev 0; mmc part

Hello @Edward ,

Here is the output for the commands you mentioned:

Colibri iMX6ULL # mmc info
Device: FSL_SDHC
Manufacturer ID: 3
OEM: 5344
Name: SD32G
Bus Speed: 50000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 29.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes

Colibri iMX6ULL # mmc dev 0; mmc part
switch to partitions #0, OK
mmc0 is current device

Partition Map for MMC device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            976896          344b1a3b-01     0c
  2     978944          7813120         344b1a3b-02     83

Another issue is that if I try to use run bootcmd_mmc0 the board still boots from flash memory. According to the guide mentioned in the original post, I need to use run bootcmd_mmc1 but as you mentioned there is no device in slot 1 as such it will not boot from SD card. I also tried using a micro SD to USB converter to boot from USB. I first used usb start then I used usb dev 0; usb part and got the following output:

Colibri iMX6ULL # usb dev 0; usb part

Device 0: Vendor: Generic  Rev: 9407 Prod: STORAGE DEVICE
            Type: Removable Hard Disk
            Capacity: 30448.0 MB = 29.7 GB (62357504 x 512)
... is now current device

Partition Map for USB device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            976896          344b1a3b-01     0c
  2     978944          7813120         344b1a3b-02     83

Finally I used run bootcmd_usb0 then boot. This unfortunately still booted into the flash memory instead of the USB.

-mine1252

I guess guides refer mmc1 because of presence of eMMC on some boards. In that case one mmc is eMMC (mmc0) and another one SD (mmc1). With NAND variant you have single mmc0.

How do you determine you booted from NAND? Are you sure. If indeed it is the case, then I guess you did something to defargs or another U-Boot environment variable so that it still chooses NAND. Try restoring factory default settings with
env default -a && saveenv && reset

Then try again with commands from the guide, of course using mmc0 instead of mmc1. I booted from USB not long ago. It booted fine. I guess SD would boot well as well.

Hello, @Edward,

To answer your question about how I know it is booting from NAND when I run the boot command in U-boot I get the following:

Colibri iMX6ULL # boot
Booting from NAND...

I tried to reset the environment variables with env default -a && saveenv && reset as you suggested. I then followed the guide replacing mmc1 with mmc0 and it still booted from the flashed image. When I use run bootcmd_mmc0 is it supposed to start booting because mine doesn’t?

Thanks for your help!

-mine1252

If you didn’t edit U-Boot’s bootcmd variable, then default boot will be from default memory, unless default boot fails to read kernel or something, default boot fails and distro_bootcmd will be called to look for boot on other medias.

You didn’t tell how your bootcmd_xxx fails. I just tried with USB drive, which isn’t bootable. I got this

starting USB...
Bus usb@2184000: USB EHCI 1.00
Bus usb@2184200: USB EHCI 1.00
scanning bus usb@2184000 for devices... 1 USB Device(s) found
scanning bus usb@2184200 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Device 0: Vendor:          Rev: PMAP Prod: USB DISK 2.0
            Type: Removable Hard Disk
            Capacity: 3824.0 MB = 3.7 GB (7831552 x 512)
... is now current device
Scanning usb 0:4...
No EFI system partition
   Updating MTD partitions...
BootOrder not defined
EFI boot manager: Cannot load any image

With proper USB driver I get this:

Colibri iMX6ULL # run bootcmd_usb0

Device 0: Vendor:          Rev: 1.00 Prod: USB DISK 30X
            Type: Removable Hard Disk
            Capacity: 959.0 MB = 0.9 GB (1964032 x 512)
... is now current device
Scanning usb 0:1...
Found U-Boot script /boot.scr
5752 bytes read in 3 ms (1.8 MiB/s)
## Executing script at 88280000
Loading DeviceTree: imx6ull-XXXXXX.dtb
55259 bytes read in 6 ms (8.8 MiB/s)
14 bytes read in 2 ms (6.8 KiB/s)
6339920 bytes read in 489 ms (12.4 MiB/s)
Bootargs: quiet root=PARTUUID=2f90825a-02 ro rootwait ubi.mtd=ubi console=tty1 console=ttymxc0,115200n8 consoleblank=0
Kernel image @ 0x84200000 [ 0x000000 - 0x60bd50 ]
## Flattened Device Tree blob at 88200000
   Booting using the fdt blob at 0x88200000
   Loading Device Tree to 8ffcf000, end 8fffffff ... OK
   Updating MTD partitions...

Starting kernel ...

And once it boots you may confirm root is on /dev/sdaX instead of default ubi0:rootfs :

# mount | grep "on / "
/dev/sda2 on / type ext4 (rw,noatime)

Hey @Mine1252,

Were you able to resolve this issue?

-Eric

FWIW, I just ran into a similar issue, and this one was the only relevant match I could find, hence the heads-up here:

To specify the problem: u-boot may report MMC: no card present and fail to boot from the SD card, even though the card is present and showing up in mmc part and correct data from mmc info.

I managed to circumvent the problem by reformatting the card. Clearly, there are some combinations of partition and/or filesystem that can cause this behaviour. But the documentation is not explicit on the constraints, and hence it is possible to hit this somewhat obscure error based on a relatively simple problem of assumption.

For the record, the partition was recognized and SD boot working when using the following partition layout:

Device Boot Start End Sectors Size Id Type
… 2048 1050623 1048576 512M c W95 FAT32 (LBA)

and a filesystem created with mkfs.vfat.

Please do not hijack an old thread, even if you believe you have the same issue. Instead, create a new one and include the following information that was missing in your post here:

  • The full module name, including its hardware revision,
  • Details about the carrier board you are using,
  • Information about the image and U-Boot version you are using,
  • Detailed steps to reproduce your issue, along with the system’s response details you’ve got for those steps.