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.

DRA821U: eMMC flashing using DFU

Part Number: DRA821U
Other Parts Discussed in Thread: DRA821, TDA4VM, AM62A7,

Tool/software:

Dear team, 

Kindly assist us on how to flash eMMC through DFU interface. Also provide the tools/application and steps to flash the device.

Regards,
Kaushal

  • Hi,

    We have refered below mentioned ti-community link to flash using DFU, seems like it is flashing and observed in bootprints when booting from emmc
    URL : e2e.ti.com/.../faq-tda4vm-j721e-j7200-enabling-dfu-boot-on-8-0-linux-sdk
    URL : software-dl.ti.com/.../UG-DFU.html

    We are using SDK09.02

    Please check on the above request

    Regards,
    Kaushal

  • Hi Kaushal 

    Please go through the appnote to understand the flashing technique on TDA4  devices.

    TDA4 Flashing Techniques (ti.com)

    Let us know if you still have further question on this.

    Regards
    Diwakar

  • Hi Diwakar,

    We are facing below mentioned error pints in uboot while doing dfu boot and ums command
    UMS: LUN 0, dev mmc 0, hwpart 0, sector 0x0, count 0x1d5a000
    cdns-usb3-peripheral usb@6000000: Unable to get USB2 phy (ret -61)
    cdns-usb3-peripheral usb@6000000: Unable to get USB3 phy (ret -61)
    cdns-usb3-peripheral usb@6000000: DRD version v1 (ID: 0004024e, rev: 00000200)
    cdns-usb3-peripheral usb@6000000: Initialized ep0 support:
    cdns-usb3-peripheral usb@6000000: Initialized ep1out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep2out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep3out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep4out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep5out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep6out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep7out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep8out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep9out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep10out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep11out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep12out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep13out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep14out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep15out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep1in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep2in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep3in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep4in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep5in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep6in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep7in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep8in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep9in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep10in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep11in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep12in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep13in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep14in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized ep15in support: BULK, INT ISO

    We observed there are some open quries on TI forum related to this. is it resolved? or still open. since we observing same error in 09.02 SDK
    e2e.ti.com/.../tda4ve-q1-ums-didn-t-work
    e2e.ti.com/.../5170492
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1162175/sk-tda4vm-u-boot-ums-does-not-work-stably?tisearch=e2e-sitesearch&keymatch=j7200%2525252520usb%25252525406000000%252525253A%2525252520Unable%2525252520to%2525252520get%2525252520USB2%2525252520phy%2525252520%2525252528ret%2525252520-2%2525252529#

    Regards,
    Kaushal

  • HI Kaushal 

    DFU and UMS are two different things.

    Are you able to flash the emmc using DFU ?

    Regards
    Diwakar

  • Hi Diwakar,

    We are able to flash using DFU Tool, but only tiboot3.bin and tispl.bin binaries are flashing but while trying to send u-boot.img we are facing below error

    ####MMC: block number 0x2110 exceeds max(0x2000)

    Also in flashing documentation it is mentioned to flash tiboot3.bin and sysfw.itb bins separately, but as per i understood sysfw.itb is embedded in tiboot3.bin, so is there any updates need to do while flashing this (like mmc write command block count)

    UMS is also a feature important to us to validate usb peripheral mode in uboot.

    Kindly do the needful

    Regards,
    Kaushal

  • HI Diwakar,

    Any updates?

    Regards,
    Kaushal

  • HI Kaushal,

    We are able to flash using DFU Tool, but only tiboot3.bin and tispl.bin binaries are flashing but while trying to send u-boot.img we are facing below error

    Are you testing it on EVM or on the custom board ? We have validated the steps so far we haven't came across any issue with the DFU.

    Help share the full  logs as well.

    Also in flashing documentation it is mentioned to flash tiboot3.bin and sysfw.itb bins separately, but as per i understood sysfw.itb is embedded in tiboot3.bin, so is there any updates need to do while flashing this (like mmc write command block count)

    The documentation was created a while ago based on TDA4VM device which follow legacy boot flow you are using DRA821 which uses combined boot flow no need to send sysfw.itb . TIFS will get packaged with the tiboot3.bin only.

    UMS is also a feature important to us to validate usb peripheral mode in uboot.

    Please raise a separate thread for this.

    Regards
    Diwakar

  • Hi Diwakar,

    Are you testing it on EVM or on the custom board ? We have validated the steps so far we haven't came across any issue with the DFU.

    Yes, we are using our custom board. 

    Help share the full  logs as well.

    Attached log: 

    U-Boot SPL 2023.04-dirty (Aug 01 2024 - 20:27:52 +0530)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
    i2c_write: error waiting for data ACK (status=0x116)
    read error from device: 41c86544 register: x!
    
    -----------spl_board_init----------
    Trying to boot from DFU
    ####DOWNLOAD ... OK
    Ctrl+C to exit ...
    Loading Environment from nowhere... OK
    init_env from device 18 not supported!
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
    NOTICE:  BL31: Built : 16:09:05, Feb  9 2024
    I/TC: 
    I/TC: OP-TEE version: 4.1.0-51-g012cdca49 (gcc version 11.4.0 (GCC)) #1 Tue Jan 30 10:48:03 UTC 2024 aarch64
    I/TC: WARNING: This OP-TEE configuration might be insecure!
    I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
    I/TC: Primary CPU initializing
    I/TC: GIC redistributor base address not provided
    I/TC: Assuming default GIC group status and modifier
    I/TC: SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
    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 2023.04-dirty (Aug 01 2024 - 20:27:47 +0530)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
    
    -----------spl_board_init----------
    Trying to boot from DFU
    cdns-usb3-peripheral usb@6000000: Unable to get USB2 phy (ret -2)
    cdns-usb3-peripheral usb@6000000: Unable to get USB3 phy (ret -61)
    cdns-usb3-peripheral usb@6000000: DRD version v1 (ID: 0004024e, rev: 00000200)
    cdns-usb3-peripheral usb@6000000: Initialized  ep0 support:  
    cdns-usb3-peripheral usb@6000000: Initialized  ep1out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep2out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep3out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep4out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep5out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep6out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep7out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep8out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep9out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep10out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep11out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep12out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep13out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep14out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep15out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep1in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep2in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep3in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep4in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep5in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep6in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep7in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep8in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep9in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep10in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep11in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep12in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep13in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep14in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep15in support: BULK, INT ISO
    #####DOWNLOAD ... OK
    Ctrl+C to exit ...
    
    
    U-Boot 2023.04-dirty (Aug 01 2024 - 20:27:47 +0530)
    
    SoC:   J7200 SR2.0 GP
    Model: Texas Instruments K3 J7200 SoC
    DRAM:  2 GiB
    
    -board-init-----------
    Core:  77 devices, 32 uclasses, devicetree: separate
    Flash: 0 Bytes
    MMC:   mmc@4f80000: 0, mmc@4fb0000: 1
    Loading Environment from nowhere... OK
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    am65_cpsw_nuss ethernet@c000000: K3 CPSW: nuss_ver: 0x6BA02102 cpsw_ver: 0x6BA82102 ale_ver: 0x00294104 Ports:4 mdio_freq:1000000
    
    ------board late init---------------
    Net:   No ethernet found.
    
    Hit any key to stop autoboot:  2  0 
    => 
    => 
    => 
    => env default -f -a
    ## Resetting to default environment
    => setenv mmcdev 0
    => setenv bootpart 0
    => saveenv
    Unknown command 'saveenv' - try 'help'
    => setenv dfu_alt_info ${dfu_alt_info_emmc}
    => gpt write mmc 0 ${partitions}
    Writing GPT: success!
    => dfu 0 mmc 0
    cdns-usb3-peripheral usb@6000000: Unable to get USB2 phy (ret -2)
    cdns-usb3-peripheral usb@6000000: Unable to get USB3 phy (ret -61)
    cdns-usb3-peripheral usb@6000000: DRD version v1 (ID: 0004024e, rev: 00000200)
    cdns-usb3-peripheral usb@6000000: Initialized  ep0 support:  
    cdns-usb3-peripheral usb@6000000: Initialized  ep1out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep2out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep3out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep4out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep5out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep6out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep7out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep8out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep9out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep10out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep11out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep12out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep13out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep14out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep15out support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep1in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep2in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep3in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep4in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep5in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep6in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep7in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep8in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep9in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep10in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep11in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep12in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep13in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep14in support: BULK, INT ISO
    cdns-usb3-peripheral usb@6000000: Initialized  ep15in support: BULK, INT ISO
    ###DOWNLOAD ... OK
    Ctrl+C to exit ...
    ####DOWNLOAD ... OK
    Ctrl+C to exit ...
    ####MMC: block number 0x2110 exceeds max(0x2000)
    MMC operation failed#

    Regards,
    Kaushal

  • HI Kaushal 

    What is the size of the UBOOT image you are using ?

    Base on that you need to calculate the Block numbers and modify it in the k3_dfu.h

    Regards
    Diwakar

  • Dear Diwakar,


    image size are mentioned below
    tiboot3.bin - 530666 bytes
    tispl.bin - 1018479 bytes
    u-boot.img - 1187547 bytes

    We tried to convert u-boot.img size to block (updated in dfu args) and write to emmc, still we are facing same issue

    Regards,
    Kaushal

  • HI Kaushal 

    What is the block numbers you kept and what was the error have you tried printing the dfu_alt_info_emmc in UBOOT 

    Regards
    Diwakar

  • Hi Diwakar,

    we have kept block size as 0x910
    In the DFU settings the uboot.img try to write from 0x1800 and block count of 0x910 which will exceeds (0x2000), but we are not sure how this limit(0x2000) is set..?

    it seems we are not able/allowed to change the starting address of the images in emmc (ex: tiboot3.bin - 0, tispl.bin - 0x800, uboot.img - 0x1800) because sourcecode will expect the binaries from this address.

    Regards,
    Kaushal

  • Hi Kaushal 

    Please go through my earlier response on how to set the number of blocks

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1393440/dra821u-emmc-flashing-using-dfu/5341516#5341516

    After making above changes you need to build the UBOOT using command "make u-boot".

    Regards
    Diwakar

  • Dear Diwakar,

    We are able to flash and boot in emmc using DFU, but when kernel is loading we observed gpt partition table is created during flashing procedure
    gpt write mmc 0 ${partitions}
    and we flashed rootfs using dfu as mentioned below
    sudo dfu-util -a rootfs -D rootfs.wic

    we suspect gpt partition is causing the issue, while loading kernel from uboot is unable to read this partition and also time took for flashing is more(nearly 1hr).
    So is there any method to avoid gpt partition and flash with fat and ext4 partition

    Regards
    Diwakar

  • HI Kaushal 

    Please go through the section "3.3 Generating the eMMC tisdk-tiny-image.img" of https://www.ti.com/lit/an/spracy5/spracy5.pdf 

    d also time took for flashing is more(nearly 1hr).

    The flashing time depends on the size of the image the restriction is from the dfu tool., There are various factor involved for a slow transfer speed, involvement of usb driver stack ,class driver stack and also in DFU only one end point is getting used which is end point 0.

    Regards
    Diwakar

  • Hi Diwakar,

    We are using same DFU tool version for AM62A7 processor and there 7GB of file takes 15mins to flash, but here in DRA821U processor it takes around 1hour. How do we reduce this flashing time.

    Regards,
    Kaushal

  • Hi kaushal 

    What is the SDK you are using for AM62A7?

    Afaik they both use different usb host controller.

    Regards 

    Diwakar 

  • Hi Diwakar,

    We used Linux 09.01 SDK for AM6267

    Regards,
    Kaushal

  • Hi Diwakar

    In AM62A7while flashing .wic image using dfu tool, emmc will automatically formated to vfat and ext4 partition(even if there is no partition table present in emmc), but with DRA821 if there is no partition table exists in emmc we are not able to mount emmc using dfu 0 mmc 0 command.

    This is critical for us, kindly support in this.

    Regards,
    Kaushal

  • HI Kaushal,

    As said earlier AM62 and DRA821 are using different controller so it is not a ideal comparison.  

    You need to follow the steps mentioned in the TDA4 flashing document.

    Regards
    Diwakar