This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5728: Error while loading Uboot :: Partition 1 not valid on device 1

Part Number: AM5728

Hello,

We are working on AM5728 based custom board and trying to load u-boot and kernel filesystem through eMMC.

The following steps were followed:

1. U-boot and kernel images were compiled and created for custom board

2. Boot Mode is kept at SD-Card, the above-generated images were loaded into SD Card.

3. Board is booting up perfectly and working fine through SD-CARD.

4. eMMc partitions was created successfully for both u-boot (mmc1blk1p1) and kernel ( mmc1blk1p2 )

5.  Files for uboot were copied from /run/media/mmc1blk0p1/ to mmc1blk1p1 partition after mounting it.

6. Files for kernel were copied from /run/media/mmc1blk0p2 to mmc1blk1p2 after mounting it properly

7. SD Card was removed and reboot the card.

Following errors are coming while booting from eMMc.

U-Boot SPL 2019.01-g82f62fa-dirty (Aug 09 2021 - 16:52:32 +0530)
DRA752-GP ES2.0                        
Card did not respond to voltage select!
Firmware loading failed                
                                       
Size get_effective_memsize = 7f000000 , CONFIG_MAX_MEM_MAPPED = ffffffea80000000 , ram
size = 100000000
Trying to boot from MMC2_2              
env_init: Environment FAT init done (ret=-2)
env_init: Environment MMC init done (ret=-2)
Loading Environment from FAT...        
*********env_fat_load() ************
Card did not respond to voltage select!
Failed (-5)
Loading Environment from MMC...
*********** env_mmc_load() env_mmc_load***********
*** Warning - bad CRC, using default environment

BAD CRC Failed (-5)
** Partition 1 not valid on device 1 **
spl_register_fat_device: fat register err - -1
spl_load_image_fat_buf: error reading image u-boot.img, err - -1
env_init: Environment FAT init done (ret=-2)
env_init: Environment MMC init done (ret=-2)
Loading Environment from FAT...
*********env_fat_load() ************
Card did not respond to voltage select!
Failed (-5)
Loading Environment from MMC...
*********** env_mmc_load() env_mmc_load***********
*** Warning - bad CRC, using default environment

BAD CRC Failed (-5)
spl: no partition table found
SPL: failed to boot from all boot devices
ERROR ### Please RESET the board ###

Regards

Sahil Kalra

  • Hi Keerthy,

    Thank you for your response.

    We have a TI AM5728 EVM with me. We tried eMMC booting on it after following the same steps as listed in the query. EVM was able to boot from eMMC without errors.

    However, we face the issue on our AM5728 custom board and get errors while booting from eMMC. FYI, there are no Pinmux changes with respect to MMC2 (eMMC) on the custom board. It is completely the same as EVM, only the capacity is increased from 4 GB to 32GB.

    After following the same set of steps, we are not able to boot from eMMC on the custom board but it is working on EVM.

    Can you suggest if there are additional changes required for eMMC boot?

    Please note that eMMC boot is a critical requirement for us. 

    Regards,

    Sahil

  • Sahil,

    Are you able to boot kernel prompt using the TI AM5728 EVM?

    If not please look at this FAQ: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/997276/faq-am5749-am5749-am57x-emmc-cannot-boot-with-fat-mode

    Please confirm first if the kernel boot from eMMC is successful on the TI device.

    - Keerthy

  • Hi Keerthy,

    We are able to boot to kernel from eMMC using TI AM5728 EVM. 

    We have followed the following procedure to update files on eMMC in both cases (TI AM5728 EVM & Custom Board)

    root@am57xx-evm:~# 
    root@am57xx-evm:~# fdisk /dev/mmcblk1
    
    Welcome to fdisk (util-linux 2.32.1).
    Changes will remain i[   41.158090]  mmcblk1:
    n memory only, until you decide to write them.
    Be careful before using the write command.
    
    
    Command (m for help): o
    Created a new DOS disklabel with disk identifier 0x1086d879.
    
    Command (m for help): p
    Disk /dev/mmcblk1: 29.7 GiB, 31826378752 bytes, 62160896 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: 0x1086d879
    
    Command (m for help): n
    Partition type
       p   primary (0 primary, 0 extended, 4 free)
       e   extended (container for logical partitions)
    Select (default p): p
    Partition number (1-4, default 1): 1
    First sector (2048-62160895, default 2048): 
    Last sector, +sectors or +size{K,M,G,T,P} (2048-62160895, default 62160895): +70M
    
    Created a new partition 1 of type 'Linux' and of size 70 MiB.
    Partition #1 contains a vfat signature.
    
    Do you want to remove the signature? [Y]es/[N]o: Y
    
    The signature will be removed by a write command.
    
    Command (m for help): t
    Selected partition 1
    Hex code (type L to list all codes): c
    Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.
    
    Command (m for help): a
    Selected partition 1
    The bootable flag on partition 1 is enabled now.
    
    Command (m for help): n
    Partition type
       p   primary (1 primary, 0 extended, 3 free)
       e   extended (container for logical partitions)
    Select (default p): p
    Partition number (2-4, default 2): 2
    First sector (145408-62160895, default 145408): 
    Last sector, +sectors or +size{K,M,G,T,P} (145408-62160895, default 62160895): 
    
    Created a new partition 2 of type 'Linux' and of size 29.6 GiB.
    Partition #2 contains a ext4 signature.
    
    Do you want to remove the signature? [Y]es/[N]o: Y
    
    The signature will be removed by a write command.
    
    Command (m for help): p
    Disk /dev/mmcblk1: 29.7 GiB, 31826378752 bytes, 62160896 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: 0x1086d879
    
    Device         Boot  Start      End  Sectors  Size Id Type
    /dev/mmcblk1p1 *      2048   145407   143360   70M  c W95 FAT32 (LBA)
    /dev/mmcblk1p2      145408 62160895 62015488 29.6G 83 Linux
    
    Filesystem/RAID signature on partition 1 will be wiped.
    Filesystem/RAID signature on partition 2 will be wiped.
    
    Command (m for help): w
    The partition table has been altered.
    Calling ioctl() to re-read partition table.
    [   64.383965]  mmcblk1: p1 p2
    Syncing disks.
    
    root@am57xx-evm:~# 
    root@am57xx-evm:~# sync
    root@am57xx-evm:~# sync
    root@am57xx-evm:~# umount /dev/mmcblk1p*
    umount: /dev/mmcblk1p1: not mounted.
    umount: /dev/mmcblk1p2: not mounted.
    root@am57xx-evm:~# mkfs.vfat -F 32 -n "boot" /dev/mmcblk1p1
    mkfs.fat 4.1 (2017-01-24)
    mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
    root@am57xx-evm:~# mkfs.ext4 -L "rootfs" /dev/mmcblk1p2
    mke2fs 1.44.3 (10-July-2018)
    64-bit filesystem support is not enabled.  The larger fields afforded by this feature enable full-strength checksumming.  Pass -O 64bit to rectify.
    Discarding device blocks: [  128.004549] NET: Registered protocol family 15
    [  128.061007] Initializing XFRM netlink socket
    done                            
    Creating filesystem with 7751936 4k blocks and 1941504 inodes
    Filesystem UUID: 7e8ec789-0cc3-481d-8046-3c472fa68cf4
    Superblock backups stored on blocks: 
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
            4096000
    
    Allocating group tables: done                            
    Writing inode tables: done                            
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done   
    
    root@am57xx-evm:~# mount -t vfat /dev/mmcblk1p1 /mnt2/
    root@am57xx-evm:~# cp -f /run/media/mmcblk0p1/* /mnt2/                                                                                                                                                   
    root@am57xx-evm:~# sync
    root@am57xx-evm:~# umount /dev/mmcblk1p1
    root@am57xx-evm:~# mount -t ext4 /dev/mmcblk1p2 /mnt2/
    [  225.744275] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
    root@am57xx-evm:/# tar -Jxvf tisdk-docker-rootfs-image-am57xx-evm.tar.xz  -C  /mnt2/
    ...
    root@am57xx-evm:~# sync
    root@am57xx-evm:~# umount /dev/mmcblk1p2 
    root@am57xx-evm:~# mount /dev/mmcblk1p1 /mnt2/
    root@am57xx-evm:~# ls /mnt2/
    MLO                dra7-ipu1-fw.xem4  u-boot.img         uEnv.txt
    root@am57xx-evm:~# umount /dev/mmcblk1p1
    root@am57xx-evm:~# mount /dev/mmcblk1p2 /mnt2/
    [  476.675770] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
    root@am57xx-evm:~# ls /mnt2/
    bin         dev         home        lib         lost+found  mnt         run         srv         tmp         var
    boot        etc         include     linuxrc     media       proc        sbin        sys         usr
    root@am57xx-evm:~# umount /dev/mmcblk1p2 
    root@am57xx-evm:~# fdisk -l /dev/mmcblk1
    Disk /dev/mmcblk1: 29.7 GiB, 31826378752 bytes, 62160896 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: 0xc50f928f
    
    Device         Boot  Start      End  Sectors  Size Id Type
    /dev/mmcblk1p1 *      2048   145407   143360   70M  c W95 FAT32 (LBA)
    /dev/mmcblk1p2      145408 62160895 62015488 29.6G 83 Linux
    root@am57xx-evm:~# fdisk -l /dev/mmcblk0
    Disk /dev/mmcblk0: 14.8 GiB, 15836643328 bytes, 30930944 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: 0x517852c0
    
    Device         Boot  Start      End  Sectors  Size Id Type
    /dev/mmcblk0p1 *      2048   145407   143360   70M  c W95 FAT32 (LBA)
    /dev/mmcblk0p2      145408 30898175 30752768 14.7G 83 Linux
    

    Furthermore, we are also able to boot to kernel from eMMC on our custom board. We used the following procedure to boot to kernel from eMMC on custom board -

    • Load u-boot using SD card
    • Stop at u-boot prompt
    • setenv mmcdev 1
    • setenv bootpart 1:2
    • setenv fdtfile am57xx-beagle-x15.dts
    • run mmcboot

    And the kernel boots from eMMC on the custom board. 

    However, when trying to load u-boot it is showing errors as mentioned in the original post.

    Regards,

    Sahil

  • Sahil,

    So if i understand the issue on custom board correctly. Booting kernel from eMMC is all fine.

    But when booting the u-boot from eMMC you are facing a hang. The same hang is not seen on
    TI AM5728 EVM with booting u-boot from eMMC. Is that a correct summary?


    - Keerthy

  • Keerthy,

    Yes, this is correct.

    Regards

    Sahil Kalra

  • Sahil,

    Have you tried the steps mentioned in the documentation:

    https://software-dl.ti.com/processor-sdk-linux/esd/docs/06_03_00_106/linux/Foundational_Components_U-Boot.html

    Look at sections: 

    3.1.1.6.1. Partitioning eMMC from U-Boot



    3.1.1.6.4. Updating an SD card or eMMC with RAW writes

    Best Regards,
    Keerthy

  • Hello Keerthy,

    Yes, I am able to boot from eMMC keeping the u-boot partition in RAW Mode. But boot from eMMC is not working in FAT mode

    However, it is still not clear, How it is working in AM5728 EVM with u-boot partition in FAT32 Mode?

    Regards

    Sahil Kalra

  • Sahil,

    It is always recommended to boot from eMMC boot partition. So you boot from eMMC boot partition & then
    file system is in the other partition. I believe you are able to do both on your board?


    Yes, I am able to boot from eMMC keeping the u-boot partition in RAW Mode.

    Can we close this issue?

    However, it is still not clear, How it is working in AM5728 EVM with u-boot partition in FAT32 Mode?

    I have never tried FAT32 partition on eMMC. The above steps should be followed to boot from eMMC.

    If no other questions click on verify answer.

    - Keerthy