Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

SK-AM62: Fail to boot up from EMMC

Part Number: SK-AM62
Other Parts Discussed in Thread: AM625,

Hi Sir

I rebuild the u-boot with “am62x_evm_r5_usbdfu_defconfig” and  “am62x_evm_a53_defconfig” in Rules.make.

then do steps from host PC as below:

1.

  • sudo dfu-util -R -a bootloader -D tiboot3.bin
  • sudo dfu-util -R -a tispl.bin -D tispl.bin
  • sudo dfu-util -R -a u-boot.img -D u-boot.img

2.

  • setenv dfu_alt_info ${dfu_alt_info_emmc}
  • dfu 0 mmc 0

3.Then I get tiboot3.bin , tispl.bin,u-boot.img from prebuild-images/  and flash them as below:

  • sudo dfu-util -a tiboot3.bin.raw -D <your_tiboot3.bin>
  • sudo dfu-util -a tispl.bin.raw -D <your_tispl.bin>
  • sudo dfu-util -a u-boot.img.raw -D <your_u-boot.img>
  • sudo dfu-util -a rootfs -D <your_rootfs.ext4>

 

For the rootfs.ext4, I use the default image from SDK and make the rootfs.ext4.

Then I switch the boot mode [SW2:SW1] to EMMC boot .

But from the serial port , there is no any log print. it seems that U-boot dont work.

could you help on it? 

 

note: The evm can boot up from SD card mode. it works fine.

 

thanks

  • Hi 

    When I download the image from HOST to EVM,the serial log print is as below:


    U-Boot SPL 2021.01 (Feb 09 2023 - 17:36:25 +0800)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
    SPL initial stack usage: 13424 bytes
    Trying to boot from DFU
    ################################################DOWNLOAD ... OK
    Ctrl+C to exit ...
    Loading Environment from MMC... MMC Device 0 not found
    *** Warning - No MMC card found, using default environment

    init_env from device 10 not supported!
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.7(release):v2.7.0-359-g1309c6c805-dirty
    NOTICE: BL31: Built : 11:48:12, Dec 14 2022
    I/TC:
    I/TC: OP-TEE version: 3.19.0-15-gd6c5d0037 (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 Wed Dec 14 11:52:03 UTC 2022 aarch64
    I/TC: WARNING: This OP-TEE configuration might be insecure!
    I/TC: WARNING: Please check optee.readthedocs.io/.../porting_guidelines.html
    I/TC: Primary CPU initializing
    I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
    I/TC: HUK Initialized
    I/TC: Activated SA2UL device
    I/TC: Fixing SA2UL firewall owner for GP device
    I/TC: Enabled firewalls for SA2UL TRNG device
    I/TC: SA2UL TRNG initialized
    I/TC: SA2UL Drivers initialized
    I/TC: Primary CPU switching to normal world boot

    U-Boot SPL 2021.01 (Feb 09 2023 - 17:36:19 +0800)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
    Trying to boot from DFU
    ####DOWNLOAD ... OK
    Ctrl+C to exit ...


    U-Boot 2021.01 (Feb 09 2023 - 17:36:19 +0800)

    SoC: AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E3
    DRAM: 2 GiB
    MMC: mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    In: serial@2800000
    Out: serial@2800000
    Err: serial@2800000
    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!
    =>
    => setenv dfu_alt_info ${dfu_alt_info_emmc}
    => dfu 0 mmc 0
    ##DOWNLOAD ... OK
    Ctrl+C to exit ...
    ####DOWNLOAD ... OK
    Ctrl+C to exit ...
    ####DOWNLOAD ... OK
    Ctrl+C to exit ...
    ####################################DOWNLOAD ... OK
    Ctrl+C to exit ...

    After this, I switch the boot mode to EMMC boot mode, But then there is no any log print in serial print.

    thanks

  • Hello,
    Did you run the following cmds@u-boot to give RBL access to eMMC boot partitions after eMMC flashing?
    => mmc partconf 0 1 1 1
    => mmc bootbus 0 2 0 0
    This is mentioned in
    software-dl.ti.com/.../UG-Memory.html
    Best,
    -Hong

  • Hi Hong,

    Yes.after I run your CMD.there is some log print as below:

    ?
    U-Boot SPL 2021.01-g3983bffabc (Dec 14 2022 - 11:53:21 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
    SPL initial stack usage: 13424 bytes
    Trying to boot from MMC1
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    init_env from device 9 not supported!
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.7(release):v2.7.0-359-g1309c6c805-dirty
    NOTICE: BL31: Built : 11:48:12, Dec 14 2022
    I/TC:
    I/TC: OP-TEE version: 3.19.0-15-gd6c5d0037 (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 Wed Dec 14 11:52:03 UTC 2022 aarch64
    I/TC: WARNING: This OP-TEE configuration might be insecure!
    I/TC: WARNING: Please check optee.readthedocs.io/.../porting_guidelines.html
    I/TC: Primary CPU initializing
    I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
    I/TC: HUK Initialized
    I/TC: Activated SA2UL device
    I/TC: Fixing SA2UL firewall owner for GP device
    I/TC: Enabled firewalls for SA2UL TRNG device
    I/TC: SA2UL TRNG initialized
    I/TC: SA2UL Drivers initialized
    I/TC: Primary CPU switching to normal world boot

    U-Boot SPL 2021.01-g3983bffabc (Dec 14 2022 - 11:52:19 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
    Trying to boot from MMC1


    U-Boot 2021.01-g3983bffabc (Dec 14 2022 - 11:52:19 +0000)

    SoC: AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E3
    DRAM: 2 GiB
    MMC: mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    In: serial@2800000
    Out: serial@2800000
    Err: serial@2800000
    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!
    =>

    it seems that the rootfs is incorrect. I have a try to make the .ext4 file by copying the all files from targetNFS to our /mnt/test/rootfs/.

    I use tisdk-default-image-am62xx-evm.tar.xz and make the targetNFS. 

    But when I use 

    • sudo dfu-util -a rootfs -D <your_rootfs.ext4>

    it display the size is too big.

    How do I make the right .ext4 file?

    thanks

  • Hello,
    We tested the full Linux (root_fs="tisdk-base-image-am64xx-evm.tar.xz") eMMC flashing with USB-DFU on AM64x EVM for your reference.
    e2e.ti.com/.../4097792
    Best,
    -Hong

  • Hi Hong,

    I follow your steps.But it still fail to download the rootfs to EVM.The log from HOST is below:

    test@test-300E4A-300E5A-300E7A-3430EA-3530EA:~/ti-processor-sdk-linux-am62xx-evm-08.05.00.21/fs/new_fs$ sudo dfu-util -c 1 -i 0 -a 1 -D rootfs.ext4

    dfu-util 0.9

     

    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.

    Copyright 2010-2016 Tormod Volden and Stefan Schmidt

    This program is Free Software and has ABSOLUTELY NO WARRANTY

    Please report bugs to sourceforge.net/.../

     

    dfu-util: Invalid DFU suffix signature

    dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!

    Opening DFU capable USB device...

    ID 0451:6165

    Run-time device DFU version 0110

    Claiming USB DFU Interface...

    Setting Alternate Setting #1 ...

    Determining device status: state = dfuIDLE, status = 0

    dfuIDLE, continuing

    DFU mode device DFU version 0110

    Device returned transfer size 4096

    Copying data from PC to DFU device

    Download     [=                        ]   4%     13893632 bytes failed!

    state(10) = dfuERROR, status(14) = Something went wrong, but the device does not know what it was

    test@test-300E4A-300E5A-300E7A-3430EA-3530EA:~/ti-processor-sdk-linux-am62xx-evm-08.05.00.21/fs/new_fs$

    it's my host log print. I use the tisdk-base-image-am62xx-evm.tar.xz. After unziping the tar file, it's 329M and 336344K.

    So I do execute below cmd:

    1.dd if=/dev/null of=rootfs.ext4 bs=1M seek=330

    2.mkfs.ext4 -F rootfs.ext4

    3.mkdir mnt_fs

    4.sudo mount -t ext4 rootfs.ext4 mnt_fs

    5.cd mnt_fs

    6.tar xvf ../tisdk-base-image-am62xx-evm.tar.xz 

    7.cd ..

    8.sudo umount mnt_fs

    Then I use below cmd to download the rootfs to EVM:

    sudo dfu-util -c 1 -i 0 -a 1 -D rootfs.ext4

    Then you can see the above error log print from HOST.

    thanks

  • Hi Hong,

    The board is SK-AM62 E3A.

    we had a try by using other fs img. it's the same result. it will failed when downloading to 4%.

    thanks

  • Hi Hong,

    I also provide the serial log print as below:

    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    init_env from device 9 not supported!
    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.7(release):v2.7.0-359-g1309c6c805-dirty
    NOTICE: BL31: Built : 11:48:12, Dec 14 2022
    I/TC:
    I/TC: OP-TEE version: 3.19.0-15-gd6c5d0037 (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 Wed Dec 14 11:52:03 UTC 2022 aarch64
    I/TC: WARNING: This OP-TEE configuration might be insecure!
    I/TC: WARNING: Please check optee.readthedocs.io/.../porting_guidelines.html
    I/TC: Primary CPU initializing
    I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
    I/TC: HUK Initialized
    I/TC: Activated SA2UL device
    I/TC: Fixing SA2UL firewall owner for GP device
    I/TC: Enabled firewalls for SA2UL TRNG device
    I/TC: SA2UL TRNG initialized
    I/TC: SA2UL Drivers initialized
    I/TC: Primary CPU switching to normal world boot

    U-Boot SPL 2021.01-g3983bffabc (Dec 14 2022 - 11:52:19 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
    Trying to boot from MMC1


    U-Boot 2021.01-g3983bffabc (Dec 14 2022 - 11:52:19 +0000)

    SoC: AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E3
    DRAM: 2 GiB
    MMC: mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    In: serial@2800000
    Out: serial@2800000
    Err: serial@2800000
    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!
    =>
    =>
    => setenv dfu_alt_info ${dfu_alt_info_emmc}
    => dfu 0 mmc 0
    ################################################################Request would exceed designated area!
    #

    thanks

  • Hello,
    In addition to the working test in the referenced e2e in my reply, I had another working one on AM62x-SK
    e2e.ti.com/.../4124594
    So far I've not observed the error message "Download[=] 4% 13893632 bytes failed!"  as in your test.

    By referring to the link on u-boot DFU,
    git.ti.com/gitweb
    Will you be able to add "DEBUG" in DFU u-boot build to see if you're able to capture some debug messages?
    >>>
    U-Boot implements this DFU capability (CONFIG_DFU) with the command dfu
    (cmd/dfu.c / CONFIG_CMD_DFU) based on:
    - the DFU stack (common/dfu.c and common/spl/spl_dfu.c), based on the
      USB DFU download gadget (drivers/usb/gadget/f_dfu.c)
    - The access to mediums is done in DFU backends (driver/dfu)
    <<<<
    Best,
    -Hong

  • Hi Hong,

    Could I copy all files of tisdk-base-image-am62xx-evm.tar.xz to rootfs/ of SD card?

    I have a try to unzip the tisdk-base-image-am62xx-evm.tar.xz and do below steps:

    1.insert the SD card to host PC

    2.sudo rm -rf /media/test/rootfs/* 

    3.sudo tar vxf tisdk-base-image-am62xx-evm.tar.xz -C /media/test/rootfs/

    4.switch the EVM to SD card boot mode

    5.it seems that rootfs dont works as below log print from serial port:

    Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
    Loading Environment from MMC... *** Warning - No MMC card found, using default environment

    Starting ATF on ARM64 core...

    NOTICE: BL31: v2.7(release):v2.7.0-359-g1309c6c805-dirty
    NOTICE: BL31: Built : 11:48:12, Dec 14 2022
    I/TC:
    I/TC: OP-TEE version: 3.19.0-15-gd6c5d0037 (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 Wed Dec 14 11:52:03 UTC 2022 aarch64
    I/TC: WARNING: This OP-TEE configuration might be insecure!
    I/TC: WARNING: Please check optee.readthedocs.io/.../porting_guidelines.html
    I/TC: Primary CPU initializing
    I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
    I/TC: HUK Initialized
    I/TC: Activated SA2UL device
    I/TC: Fixing SA2UL firewall owner for GP device
    I/TC: Enabled firewalls for SA2UL TRNG device
    I/TC: SA2UL TRNG initialized
    I/TC: SA2UL Drivers initialized
    I/TC: Primary CPU switching to normal world boot

    U-Boot SPL 2021.01-g3983bffabc (Dec 14 2022 - 11:52:19 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.5.3--v08.05.03 (Chill Capybar')
    Trying to boot from MMC2


    U-Boot 2021.01-g3983bffabc (Dec 14 2022 - 11:52:19 +0000)

    SoC: AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    EEPROM not available at 0x50, trying to read at 0x51
    Board: AM62-SKEVM rev E3
    DRAM: 2 GiB
    MMC: mmc@fa10000: 0, mmc@fa00000: 1, mmc@fa20000: 2
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    In: serial@2800000
    Out: serial@2800000
    Err: serial@2800000
    Net: eth0: ethernet@8000000port@1
    Hit any key to stop autoboot: 0
    switch to partitions #0, OK
    mmc1 is current device
    SD/MMC found on device 1
    Failed to load 'boot.scr'
    1490 bytes read in 4 ms (363.3 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    Running uenvcmd ...
    1 bytes read in 3 ms (0 Bytes/s)
    Already setup.
    Failed to load '/boot/Image'
    Failed to load '/boot/k3-am625-sk.dtb'
    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!
    =>
    =>
    =>

    Is it the source image issue?

    thanks

  • Hi Hong,

    I made a new SD card image based on tisdk-base-image-am62xx-evm.tar.xz by using create-sdcard.sh. it works from SD card boot mode.

    So it should not be the image issue.

    I dont know why I use the same steps as you but it always failed when download the rootfs. Is it a LINUX PC issue? or USB issue?

    I also download the same SDK(ti-processor-sdk-linux-am62xx-evm-08.03.00.19-Linux-x86-Install.bin) as you mentioned in the case. It's still the same error result.

    This is our first project with TI board. we dont know more about it.plz help on it.

    thanks

  • Hello Peter,
    As in my last reply, I've not observed the error message "Download[=] 4% 13893632 bytes failed!" in my test run. Some relevant modules/drivers... are listed below from u-boot DFU. Will you be able to add "DEBUG" in some of the related *.c files from the list below, rebuild the u-boot, and re-run USB-DFU flashing to see if you're able to capture debug messages to help debugging the issue?
    git.ti.com/gitweb
    >>>
    13 U-Boot implements this DFU capability (CONFIG_DFU) with the command dfu
    14 (cmd/dfu.c / CONFIG_CMD_DFU) based on:
    15 - the DFU stack (common/dfu.c and common/spl/spl_dfu.c), based on the
    16 USB DFU download gadget (drivers/usb/gadget/f_dfu.c)
    17 - The access to mediums is done in DFU backends (driver/dfu)
    <<<<
    Best,
    -Hong

  • Hi Hong,

    I dont understand your point.it seems that the DFU has a size limit. I have a try to use another LINUX PC. It's the same error result. we use the dfu-util version is 0.9-1.

    I dont know how to add any debug info.could you tell me how to modify any files?which file?

    The issue is reproduced at 100%. when we use a new board and there is no any image flashed.

    thanks

  • Hi Hong,

    could you share the .ext4 file with me directly? I will check if it's the .ext4 file is incorrect.

    we use ti-processor-sdk-linux-am62xx-evm-08.03.00.19-Linux-x86-Install.bin. You can provide the .ext4 file with us with the same SDK.

    thanks

  • Hi Hong,

    I check the U-boot codes.see below:

    static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
    u64 offset, void *buf, long *len)
    {
    struct mmc *mmc;
    u32 blk_start, blk_count, n = 0;
    int ret, part_num_bkp = 0;

    mmc = find_mmc_device(dfu->data.mmc.dev_num);
    if (!mmc) {
    pr_err("Device MMC %d - not found!", dfu->data.mmc.dev_num);
    return -ENODEV;
    }

    /*
    * We must ensure that we work in lba_blk_size chunks, so ALIGN
    * this value.
    */
    *len = ALIGN(*len, dfu->data.mmc.lba_blk_size);

    blk_start = dfu->data.mmc.lba_start +
    (u32)lldiv(offset, dfu->data.mmc.lba_blk_size);
    blk_count = *len / dfu->data.mmc.lba_blk_size;
    if (blk_start + blk_count >
    dfu->data.mmc.lba_start + dfu->data.mmc.lba_size) {
    puts("Request would exceed designated area!\n");
    return -EINVAL;
    }

    int dfu_write_medium_mmc(struct dfu_entity *dfu,
    u64 offset, void *buf, long *len)
    {
    int ret = -1;

    switch (dfu->layout) {
    case DFU_RAW_ADDR:
    ret = mmc_block_op(DFU_OP_WRITE, dfu, offset, buf, len);

    Why is the dfu->layout DFU_RAW_ADDR? it should be DFU_FS_EXT4 when flash the roorfs.

    thanks

  • Hi 

    the serial log print is below:

    => setenv dfu_alt_info ${dfu_alt_info_emmc}
    => dfu 0 mmc 0
    LP:it's a raw type
    LP:it's a part type
    LP:it's a raw type
    LP:it's a raw type
    LP:it's a raw type
    LP:it's a raw type
    LP:it's a raw type
    LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    #LP:enter raw handle write
    Request would exceed designated area!
    #=>

    Here when we execute the "dfu 0 mmc 0' , it had already been a raw type. 

    Then I execute " sudo dfu-util -a rootfs -D rootfs.ext4" and so it will do raw handle process. The source code log change is below:

    int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
    {..

    if (!strcmp(entity_type, "raw")) {
    puts("LP:it's a raw type\n");
    dfu->layout = DFU_RAW_ADDR;

    ..

    } else if (!strcmp(entity_type, "part")) {
    struct disk_partition partinfo;
    struct blk_desc *blk_dev = mmc_get_blk_desc(mmc);
    int mmcdev = second_arg;
    int mmcpart = third_arg;
    int offset = 0;
    puts("LP:it's a part type\n");

    ...

    } else if (!strcmp(entity_type, "fat")) {
    puts("LP:it's a fat type\n");
    dfu->layout = DFU_FS_FAT;
    } else if (!strcmp(entity_type, "ext4")) {
    puts("LP:it's ext4 raw type\n");
    dfu->layout = DFU_FS_EXT4;

    ..

    int dfu_write_medium_mmc(struct dfu_entity *dfu,
    u64 offset, void *buf, long *len)
    {
    int ret = -1;

    switch (dfu->layout) {
    case DFU_RAW_ADDR:
    puts("LP:enter raw handle write\n");
    ret = mmc_block_op(DFU_OP_WRITE, dfu, offset, buf, len);
    break;
    case DFU_FS_FAT:
    case DFU_FS_EXT4:
    puts("LP:enter ext4 handle write\n");
    ret = mmc_file_buf_write(dfu, offset, buf, len);
    break;
    default:
    printf("%s: Layout (%s) not (yet) supported!\n", __func__,
    dfu_get_layout(dfu->layout));
    }

    return ret;
    }

    it's the root cause.

    How do I change any codes or steps?

    thanks

  • Hi Hong,

    In the source code,we can see that it always enter this "if":

    * We must ensure that we work in lba_blk_size chunks, so ALIGN
    * this value.
    */
    *len = ALIGN(*len, dfu->data.mmc.lba_blk_size);

    blk_start = dfu->data.mmc.lba_start +
    (u32)lldiv(offset, dfu->data.mmc.lba_blk_size);
    blk_count = *len / dfu->data.mmc.lba_blk_size;
    if (blk_start + blk_count >
    dfu->data.mmc.lba_start + dfu->data.mmc.lba_size) {
    puts("Request would exceed designated area!\n");
    return -EINVAL;
    }

    what's the reason?

    => mmc part

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

    Part Start Sector Num Sectors UUID Type
    1 2048 32768 c1aa5f1d-01 0e Boot
    2 34816 31045632 c1aa5f1d-02 83
    =>

    thanks

  • Hi Hong,

    Now it seems that it's a partitions issue from EMMC. After I partition the EMMC. rootfs can be downloaded normally.

    But I dont know if I do the right partition.could you tell me how to restore the EMMC partition?

    I execute below cmd:

    => mmc part

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

    Part Start LBA End LBA Name
    Attributes
    Type GUID
    Partition GUID
    1 0x00000022 0x01da3fde "rootfs"
    attrs: 0x0000000000000000
    type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    guid: 46966f41-553e-e44f-b2d4-0acdb0291f67

    is it right?

    thanks

  • Hello Peter,
    It is good to know eMMC flashing works on your setup.
    Yes, it is necessary to make root_fs first as ext4
    Best,
    -Hong