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: Device is failing to load from Emmc boot

Part Number: PROCESSOR-SDK-AM62X
Other Parts Discussed in Thread: AM625

Hi ,

could you please provide the support on how to boot up the board from eMMC  .

we got boot up logs :

root@am62xx-evm:~#
U-Boot SPL 2021.01-g74fc69c889 (Sep 06 2022 - 07:53:47 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
Trying to boot from MMC1
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 ###

Thanks,

Naresh

  • Hello,
    Will you provide more details on your test setup?
    - board
    - TI SDK version
    - full log (in attachment)
    - any additional helpful info.
    Best,
    -Hong

  • Hi Hong,

    -our custom board (AM625 custom board)

    -Platform AM62x – BSP bsp_08_03_00_19

    -for eMMC boot  i am getting those logs only (which i shared in the 1st post)

    but SDCARD booting fine (SDCARD having full bootup logs )

    Thanks,

    Naresh

  • Hi Hong ,

    Any update ?

    Thanks,

    Naresh

  • Hello Naresh,
    Will you share the detailed steps used to flash eMMC on your board?
    Also what is the BOOTMODE[15:0] setup on your board?
    Best,
    -Hong

  • Hi Hong,

    we followed this wiki :https://dev.ti.com/tirex/explore/node?node=AH7UCdgUCKCwCVFiHuYcnQ__7qm9DIS__LATEST&search=am64  to flash eMMC.

    On our custom board , we are setting primary boot pins only.

    emmc boot pins configuration : SW1: B1 B2 B3 B4 B5 B6 B7 B8 pins ( 10010000 )

    Thanks ,

    Naresh

  • Hello Naresh,
    I looked at the BOOTMODE pin setup on your board.
    Can we change to "BOOTMODE[7]=1", and re-test?

    You may refer to this e2e post for reason.
    e2e.ti.com/.../4179687
    "After R5 SPL (tiboot3.bin) is loaded and run, BOOTMODE[15:0] is also used by R5 SPL to load A53 binary (tispl.bin), where "BOOTMODE[7]=1" is needed in R5 SPL as listed below in order to load tispl.bin from eMMC boot partition (raw)."

    Best,
    -Hong

  • Hi ,

    not booting boot up with the BOOTMODE[7]=1 ,same logs getting .

    logs :

    U-Boot SPL 2021.01-g74fc69c889 (Sep 06 2022 - 07:53:47 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
    Trying to boot from MMC1
    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 ###

    Thanks,

    Naresh

  • Hi Hong,

    any other methods to flash eMMC otherthan USB and SDCARD 

    we tried to flash emmc through sd card  and on on our custom board there is no typeC board so we cant able to flash emmc through USB .

    please provide your vlauable suggestions .

    could you please provide any script to flash emmc so that its easy to flash and we can rule out the flashing issue if any .

    Thanks,

    Naresh.

  • Hello Naresh,
    From your log file, it seems to me there's still a puzzle on BOOTMODE[7]=1 setup on your board.
    Can we run a simple test on your board as listed below?
    Adding a printf to dump 32bits from reading CM register @0x43000030 in R5 SPL
    Best,
    -Hong

  • Hi Hong,

    Could you please provide eMMC flashing script .

    Thanks,

    Naresh

  • Hello Naresh,
    u-boot eMMC flashing is described in
    software-dl.ti.com/.../UG-Memory.html
    Plus some reference log files are in the previously referenced e2e posts:
    - u-boot eMMC flashing from SD boot
    e2e.ti.com/.../4143508
    - full Linux eMMC flashing from USB-DFU boot
    e2e.ti.com/.../4174391

    As in my last reply "From your log file, it seems to me there's still a puzzle on BOOTMODE[7]=1 setup on your board."
    Can we add "#define DEBUG" to the very top of "u-boot/arch/arm/mach-k3/am625_init.c", rebuild the u-boot, and post the serial log?

    Best,
    -Hong

  • Hi Hong ,

    [Hong] As in my last reply "From your log file, it seems to me there's still a puzzle on BOOTMODE[7]=1 setup on your board."

    >> [Narresh] we made 7th pin is ON ,even getting same logs 


    [Hong]Can we add "#define DEBUG" to the very top of "u-boot/arch/arm/mach-k3/am625_init.c", rebuild the u-boot, and post the serial log?

    >> [Naresh] we added this "#define DEBUG " in this file -> "u-boot/arch/arm/mach-k3/am625_init.c" and compiling the uboot source code but we didnt find debug stmts (we are getting previous error logs only )

    i followeed this wiki to make parttions in eMMC : https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/08_03_00_19/exports/docs/linux/Foundational_Components/U-Boot/UG-Memory.html

    but after creating partitions i found only ROOTFS parttion ,BUT TI showing 3 parttions as below :

    on our SETUP :

    Naresh=> uuid
    8aebab27-075a-4a01-a273-99135c965882
    Naresh=> setenv uuid_gpt_disk 8aebab27-075a-4a01-a273-99135c965882
    Naresh=> uuid
    cd7593d6-d8b2-4bbd-883e-3aaf110c9af6
    Naresh=> setenv uuid_gpt_rootfs cd7593d6-d8b2-4bbd-883e-3aaf110c9af6
    Naresh=> gpt write mmc 0 ${partitions}
    Writing GPT: success!
    Naresh=> mmc part

    Naresh=> mmc part

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

    Part Start LBA End LBA Name
    Attributes
    Type GUID
    Partition GUID
    1 0x00000022 0x03b47fde "rootfs"
    attrs: 0x0000000000000000
    type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    guid: 53b83685-edd8-4215-b2a9-549927173781

    Naresh=> printenv partitions
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}

    Naresh=> printenv dfu_alt_info_mmc
    dfu_alt_info_mmc=boot part 1 1;rootfs part 1 2;tiboot3.bin fat 1 1;tispl.bin fat 1 1;u-boot.img fat1

    OBSERVATIONS : seems to be only ROOT parttion creating but boot partition is not created  thatswhy eMMC booting is failing

    TI WIKI showing as : 

    U-Boot# mmc part
    
    Partition Map for MMC device 0  --   Partition Type: DOS
    
    Partition     Start Sector     Num Sectors     Type
        1                   63          144522       c Boot
        2               160650         1847475      83
        3              2024190         1815345      83
    U-Boot # printenv partitions
    uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
    U-Boot# printenv dfu_alt_info_mmc dfu_alt_info=boot part 0 1;rootfs part 0 2;MLO fat 0 1;u-boot.img fat 0 1;uEnv.txt 
    fat 0 1"

    --------------------------------------------------------------------------------------------------------------------------

    Method 2 :
    Making parttions in eMMC using fdisk shown below


    Command (m for help): n
    Partition number (1-128, default 1): 1
    First sector (34-62160862, default 2048): 63
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (63-62160862, default 62160862): 144522

    Created a new partition 1 of type 'Linux filesystem' and of size 70.6 MiB.

    Command (m for help): n
    Partition number (2-128, default 2): 160650
    Value out of range.
    Partition number (2-128, default 2): [  131.053627] Initializing XFRM netlink socket

    First sector (144523-62160862, default 145408): 160650
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (160650-62160862, default 62160862): 1847475

    Created a new partition 2 of type 'Linux filesystem' and of size 823.7 MiB.

    Command (m for help): n
    Partition number (3-128, default 3): 3
    First sector (144523-62160862, default 1849344): 2024190
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (2024190-62160862, default 62160862): 18^H^H
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (2024190-62160862, default 62160862): 62160861

    Created a new partition 3 of type 'Linux filesystem' and of size 28.7 GiB.

    Command (m for help):


    Command (m for help): p

    Disk /dev/mmcblk0: 29.66 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: gpt
    Disk identifier: 8AEBAB27-075A-4A01-A273-99135C965882

    Device           Start      End  Sectors   Size Type
    /dev/mmcblk0p1      63   144522   144460  70.6M Linux filesystem
    /dev/mmcblk0p2  160650  1847475  1686826 823.7M Linux filesystem
    /dev/mmcblk0p3 2024190 62160861 60136672  28.7G Linux filesystem

    Command (m for help):
    CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.8 | VT102 | Offline | ttyUSB0                     





    => mmc part

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

    Part    Start LBA       End LBA         Name
            Attributes
            Type GUID
            Partition GUID
      1     0x0000003f      0x0002348a      ""
            attrs:  0x0000000000000000
            type:   0fc63daf-8483-4772-8e79-3d69d8477de4
            guid:   a50d10c8-6769-2d49-aeff-cb8188920184
      2     0x0002738a      0x001c30b3      ""
            attrs:  0x0000000000000000
            type:   0fc63daf-8483-4772-8e79-3d69d8477de4
            guid:   fd3eb059-e0e9-1940-926e-c750741d4824
      3     0x001ee2fe      0x03b47fdd      ""
            attrs:  0x0000000000000000
            type:   0fc63daf-8483-4772-8e79-3d69d8477de4
            guid:   9fc2c9f2-e533-5e47-9945-ad9bc722518e
    => printenv partitions
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
    =>
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
    => printenv dfu_alt_info_mmc
    dfu_alt_info_mmc=boot part 1 1;rootfs part 1 2;tiboot3.bin fat 1 1;tispl.bin fat 1 1;u-boot.img fa1



    TI wiki shows the partitions as below :

    U-Boot# mmc part

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

    Partition     Start Sector     Num Sectors     Type
        1                   63          144522       c Boot
        2               160650         1847475      83
        3              2024190         1815345      83



  • Hi Hong ,

    here  may i know how to BOOT from raw eMMC partition ?

    actually boot partition is of type fat right . and how the emmc images (tiboot3.bin ,tispl.bin ,u-boot.img) boot from RAW mode ? how to generate raw images and what are the RAW images required to boot from eMMC ?

    may i know what is the differnece between "raw " and " fat ".

    please help me on to fix/ressolve the issue .

    Thanks,

    Naresh

  • Hello Naresh,
    With addition of "#define DEBUG" to the very top of "u-boot/arch/arm/mach-k3/am625_init.c", serial message like below is expected.

    U-Boot SPL 2021.01-00002-g77bcc61-dirty (Aug 16 2022 - 10:24:10 -0500)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
    am625_init: spl_boot_device: devstat = 0xcb bootmedia = 0x9 bootindex = 0
    Trying to boot from MMC1
    ...

    It is worth to find out why the debug message not shown from your build, this is useful data point for debugging your issue.

    For u-boot/Linux eMMC booting on TI AM62x-SK board, eMMC layout is listed here
    software-dl.ti.com/.../UG-Memory.html
    Under <eMMC layout:>:
    - boot0 partition: raw partition for all u-boot binary
    - user partition: for ext4 rootfs where Linux kernel, DTB, rootfs...
    Best,
    -Hong

  • Hi Hong ,

    after i set primary boot pins for eMMC as : 10011000

    i am getting below Logs : 

    U-Boot SPL 2021.01-00002-g77bcc61275-dirty (Sep 27 2022 - 16:13:27 +0530)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.3.2--v08.03.02 (Jolly Jellyfi')
    am625_init: spl_boot_device: devstat = 0xcb bootmedia = 0x9 bootindex = 0
    line =820 fun=common/spl/spl.c file =spl_relocate_stack_gd
    line =605 fun=common/spl/spl.c file =board_init_r
    line =456 fun=common/spl/spl.c file =spl_set_bd
    line =482 fun=common/spl/spl.c file =spl_init
    am625_init: spl_boot_device: devstat = 0xcb bootmedia = 0x9 bootindex = 0
    line =561 fun=common/spl/spl.c file =boot_from_devices
    line =510 fun=common/spl/spl.c file =spl_ll_find_loader
    Trying to boot from MMC1
    line =531 fun=common/spl/spl.c file =spl_load_image
    line=436 fun=spl_mmc_load_image file=common/spl/spl_mmc.c
    line=343 fun=spl_mmc_load file=common/spl/spl_mmc.c
    line=140 fun=spl_mmc_find_device file=common/spl/spl_mmc.c
    line=244 fun=spl_start_uboot file=common/spl/spl_mmc.c
    line=330 fun=spl_mmc_get_uboot_raw_sector file=common/spl/spl_mmc.c
    line=56 fun=spl_mmc_raw_uboot_offset file=common/spl/spl_mmc.c
    line=73 fun=mmc_load_image_raw_sector file=common/spl/spl_mmc.c
    line=50 fun=h_spl_load_read file=common/spl/spl_mmc.c
    line=50 fun=h_spl_load_read file=common/spl/spl_mmc.c
    line=50 fun=h_spl_load_read file=common/spl/spl_mmc.c

    U-Boot 2021.01-00002-g77bcc61275-dirty (Sep 27 2022 - 16:13:27 +0530)

    SoC: AM62X SR1.0
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Reading on-board EEPROM at 0x51 failed 1
    DRAM: 2 GiB
    MMC: mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
    Loading Environment from MMC... OK
    In: serial@2800000
    Out: serial@2800000
    Err: serial@2800000
    EEPROM not available at 0x50, trying to read at 0x51
    Reading on-board EEPROM at 0x51 failed 1
    Net: eth0: ethernet@8000000port@1
    Hit any key to stop autoboot: 0
    MMC: no card present
    SD/MMC found on device 1
    MMC: no card present
    MMC: no card present
    MMC: no card present
    MMC: no card present
    MMC: no card present
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    No FDT memory address configured. Please configure
    the FDT address via "fdt addr <address>" command.
    Aborting!
    Bad Linux ARM64 Image magic!
    =>

    =>if possible could you please send me mksdboot.sh script from this wiki : 5.1.6. How to flash eMMC device — Processor SDK AM62x Documentation

    not able to find mksboot.sh script in that page , PLEASE HELP ME WITH THE SCRIPT .

    Thanks ,

    Naresh .

  • Hello Naresh,

    am625_init: spl_boot_device: devstat = 0xcb bootmedia = 0x9 bootindex = 0

    It looks like changing BOOTMODE[7] to "1" makes u-boot booting from eMMC works on your board.
    It seems some issue when loading kernel/dtb from ext4 rootfs from eMMC user partition.
    Can you take a look at this e2e post?
    e2e.ti.com/.../4214548
    Best,
    -Hong

  • Hi Hong,

    Actually on my custom board we didnt have type C port , so we cant use dfu usb commands to flash emmc .

    could you please help me with steps to flash emmc using sdcard ?

    Thanks,

    Naresh

  • Hi Hong,

    Iam  able to up the board using below steps :

    [28/09 21:09] Naresh Nakka

    Hi sir , these are steps to flash eMMC .

    EMMC BOOT Preparation :

    1.Pre-requisites : tiboot3.bin ,tispl.bin,u-boot.img ,Image ,k3-am625.dtb,filesystem

    ->enable UUID in uboot menuconfig to generate identifiers for emmc partitions

    > Command line interface > Misc commands

    [*] uuid, guid - generation of unique IDs

    Compile the uboot and generate the images and place in SDcard

    • Boot from sdcard and halt at uboot level

    Issue below commands to make Emmc partitions :

    uboot=> uuid
    8aebab27-075a-4a01-a273-99135c965882
    uboot=> setenv uuid_gpt_disk 8aebab27-075a-4a01-a273-99135c965882
    uboot=> uuid
    cd7593d6-d8b2-4bbd-883e-3aaf110c9af6
    uboot=> setenv uuid_gpt_rootfs cd7593d6-d8b2-4bbd-883e-3aaf110c9af6
    uboot=> gpt write mmc 0 ${partitions}
    Writing GPT: success!
    uboot=> mmc part

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

            Part Start LBA End LBA Name

            Attributes

      Type GUID

      Partition GUID

      0x00000022 0x03b47fde "rootfs"

      attrs: 0x0000000000000000

      type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7

      guid: 53b83685-edd8-4215-b2a9-549927173781

    2.The K3 based processors support booting from the eMMC boot partition. The following commands can be used to download

    tiboot3.bin, tispl.bin and u-boot.img from an SD card and write them to the eMMC boot0 partition at respective addresses.

            => mmc dev 0 1

            => fatload mmc 1 ${loadaddr} tiboot3.bin

            => mmc write ${loadaddr} 0x0 0x400

            => fatload mmc 1 ${loadaddr} tispl.bin

            => mmc write ${loadaddr} 0x400 0x1000

            => fatload mmc 1 ${loadaddr} u-boot.img

            => mmc write ${loadaddr} 0x1400 0x2000

     

    3. Now copy the contents of SD card rootfs partition into eMMC device rootfs partition. Run the Following commands on the target, one by one.

    $ umount /run/media/*

    $ mkdir /mnt/sd-rootfs

    $ mount /dev/mmcblk1p2 /mnt/sd-rootfs

    $ mkdir /mnt/emmc-rootfs

    $ mount /dev/mmcblk0p1 /mnt/emmc-rootfs

    $ cp -r /mnt/sd-rootfs/* /mnt/emmc-rootfs

    $ sync

    $ umount /mnt/*

    4. Come to uboot and setuenv boot settings for eMMC

    =>setenv mmcdev 0

    =>setenv bootpart 0

    =>saveenv

    5 power off and change BOOT mode pin configurations to EMMC : 10011000

    6 power on the board and check the booting

    [28/09 21:09] Naresh Nakka

    Test eMMC in uboot :

    => mmc list

    mmc@fa10000: 0 (eMMC)

    mmc@fa00000: 1

    mmc@fa20000: 2

    => mmc info

    Device: mmc@fa10000

    Manufacturer ID: 13

    OEM: 14e

    Name: G1M15

    Bus Speed: 200000000

    Mode: HS200 (200MHz)

    Rd Block Len: 512

    MMC version 5.1

    High Capacity: Yes

    Capacity: 29.6 GiB

    Bus Width: 8-bit

    Erase Group Size: 512 KiB

    HC WP Group Size: 8 MiB

    User Capacity: 29.6 GiB WRREL

    Boot Capacity: 31.5 MiB ENH

    RPMB Capacity: 4 MiB ENH

    Boot area 0 is not write protected

    Boot area 1 is not write protected

    => mmc part

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

    Part    Start LBA       End LBA         Name

            Attributes

            Type GUID

            Partition GUID

      1     0x00000022      0x03b47fde      "rootfs"

            attrs:  0x0000000000000000

            type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7

            guid:   c5389786-42a8-4a50-9bb5-2fabf59103ee

    => ls mmc 0

    <DIR>       1024 .

    <DIR>       1024 ..

    <DIR>      12288 lost+found

    <DIR>       3072 bin

    <DIR>       1024 boot

    <DIR>       1024 dev

    <DIR>       3072 etc

    <DIR>       1024 home

    <SYM>         20 init

    <DIR>       4096 lib

    <SYM>         19 linuxrc

    <DIR>       1024 media

    <DIR>       1024 mnt

    <DIR>       1024 proc

    <DIR>       1024 run

    <DIR>       3072 sbin

    <DIR>       1024 sys

    <DIR>       1024 tmp

    <DIR>       1024 usr

    <DIR>       1024 var

    => ls mmc 0 boot

    <DIR>       1024 .

    <DIR>       1024 ..

    <SYM>         31 vmlinux.gz

               31582 k3-am625-skeleton.dtb

    <SYM>         26 Image

               44485 k3-am625-sk.dtb

             9071707 vmlinux.gz-5.10.109-g9e58028f94

            21400064 Image-5.10.109-g9e58028f94

               46074 k3-am625-sk.dtb

                2033 k3-am625-sk-csi2-ov5640.dtbo

               34271 k3-am625-sk-lpmdemo.dtb

    =>

  • Hi Hong,

    once i flashed the emmc and up the bosard through eMMC .

    again i removed the eMMC and try to follow above steps .

    But  i am getting no space availble in the /mnt/emmc-sdcard while copying file system from sd to emmc using below steps :

    $ umount /run/media/*

    $ mkdir /mnt/sd-rootfs

    $ mount /dev/mmcblk1p2 /mnt/sd-rootfs

    $ mkdir /mnt/emmc-rootfs

    $ mount /dev/mmcblk0p1 /mnt/emmc-rootfs

    $ cp -r /mnt/sd-rootfs/* /mnt/emmc-rootfs

    cp: cannot create directory '/mnt/emmc-rootfs/usr/lib/xtables': No space left on device
    cp: cannot create directory '/mnt/emmc-rootfs/usr/libexec': No space left on device
    cp: cannot create directory '/mnt/emmc-rootfs/usr/sbin': No space left on device
    cp: cannot create directory '/mnt/emmc-rootfs/usr/share': No space left on device
    cp: cannot create directory '/mnt/emmc-rootfs/usr/src': No space left on device
    cp: cannot create directory '/mnt/emmc-rootfs/var': No space left on device
    cp: cannot create directory '/mnt/emmc-rootfs/www': No space left on device

    cp: write error: No space left on device
    cp: write error: No space left on device
    cp: write error: No space left on device
    cp: write error: No space left on device
    cp: write error: No space left on device
    cp: write error: No space left on device
    cp: write error: No space left on device
    cp: write error: No space left on device
    cp: write error: No space left on device
    cp: write error: No space left on device
    cp: can't create directory '/mnt/emmc-rootfs/usr/lib/python3.8/importlib': No se
    cp: write error: No space left o

    .........

    .........

    even i erased eMMC and tried but i am getting same as no space on eMMC 

    please help me on this .

    Thanks,

    Naresh

  • Hi Hong,

    Now its booting from eMMC .

    issue is resolved 

    solution : Needs to make root file system as ext4.

    $mkfs.ext4 /dev/mmcblk0p1

    then copy : $ cp -r /mnt/sd-rootfs/* /mnt/emmc-rootfs

    Thanks,

    Naresh

  • Hello Naresh,
    It is good to know you're able to have Linux boot on eMMC on your customer board.
    Best,
    -Hong