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?
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.
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.
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?
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)
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)
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.