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.

PROCESSOR-SDK-AM62X: Partition and Format eMMC in u-boot

Part Number: PROCESSOR-SDK-AM62X

Hi,

Our board uses EMMC as the storage medium and can also boot the system through the SD card. We want to partition and format EMMC during the uboot startup phase of SD, and burn the system into EMMC. 
I refer to the documentation software-dl.ti.com/.../UG-Memory.html , the hardware is configured to use EMMC UDA boot mode. After the following operations, there is always no response after resetting.

=> mmc info
Device: mmc@fa10000
Manufacturer ID: 9d
OEM: 1
Name: IS016G
Bus Speed: 52000000
Mode: MMC DDR52 (52MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 14.6 GiB
Bus Width: 8-bit DDR
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 14.6 GiB WRREL
Boot Capacity: 4 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
=> setenv uuid_gpt_disk 9fd6884f-729a-48fe-a935-a343a6ebde86
=> setenv uuid_gpt_boot 3e59e9d0-f97f-4282-af18-4a70c4c9ab59
=> setenv uuid_gpt_rootfs 2906b911-83bd-4503-8d68-1a68d78067fe
=> setenv partitions "uuid_disk=${uuid_gpt_disk};name=boot,start=2MiB,size=128MiB,uuid=${uuid_gpt_boot};name=rootfs,start=130MiB,size=-,uuid=${uuid_gpt_rootfs}"
=> gpt write mmc 0 ${partitions}
Writing GPT: success!
=> reset
resetting ...



=> mmc part

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

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00001000      0x00040fff      "boot"
        attrs:  0x0000000000000000
        type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        guid:   3e59e9d0-f97f-4282-af18-4a70c4c9ab59
  2     0x00041000      0x01d1efde      "rootfs"
        attrs:  0x0000000000000000
        type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        guid:   2906b911-83bd-4503-8d68-1a68d78067fe
=> fatload mmc 1:1 ${loadaddr} boot.vfat;mmc write ${loadaddr} 0x00001000 0x4000;
8388608 bytes read in 366 ms (21.9 MiB/s)

MMC write: dev # 0, block # 4096, count 16384 ... 16384 blocks written: OK
=> fatload mmc 1:1 ${loadaddr} rootfs.ext4;mmc write ${loadaddr} 0x00041000 0x64000;
209715200 bytes read in 8727 ms (22.9 MiB/s)

MMC write: dev # 0, block # 266240, count 409600 ... 409600 blocks written: OK
=> ls mmc 0:1
   310637   tiboot3.bin
  1161507   tispl.bin
  1086867   u-boot.img

3 file(s), 0 dir(s)

=> mmc partconf 0 1 7 1
=> mmc bootbus 0 2 0 0
Set to BOOT_BUS_WIDTH = 0x2, RESET = 0x0, BOOT_MODE = 0x0
=> reset
resetting ...


I wrote boot.vfat directly to mmc dev 0 and it can start, but a partition error will be reported.

=> mmc dev 0
switch to partitions #0, OK
mmc0(part 0) is current device
=> fatload mmc 1:1 ${loadaddr} boot.vfat;mmc write ${loadaddr} 0x00 0x4000;
8388608 bytes read in 366 ms (21.9 MiB/s)

MMC write: dev # 0, block # 0, count 16384 ... 16384 blocks written: OK
=> reset
resetting ...

U-Boot SPL 2023.04 (Nov 06 2023 - 08:53:28 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
SPL initial stack usage: 13376 bytes
Trying to boot from MMC1
** Partition 1 not valid on device 0 **
spl_register_fat_device: fat register err - -1
spl_load_image_fat: error reading image tispl.bin, err - -1
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

regards,
Stephen