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.

AM623: How can DFU support Falcon boot?

Part Number: AM623

Tool/software:

Hi TI,

I have implemented Falcon boot based on EMMC UDA RAW mode on our own board. Now we need to implement the DFU function that can support Falcon boot. Does TI have any routine reference?

  • Hi Hang,

    If you already use DFU for the normal boot mode, the only difference with DFU for falcon boot is the file size of tispl.bin binary. It is less than 1MB in normal boot, but tens of MB in falcon boot. So the following U-Boot patch is needed to increase the DFU ram buffer for tispl.bin to fit in the binary.

        env: update location and size in DFU_ALT_INFO_RAM
        
        the location matches CONFIG_SPL_LOAD_FIT_ADDRESS in R5 defconfig;
        the size to hold kernel image and initramfs.
    
    diff --git a/include/environment/ti/k3_dfu.h b/include/environment/ti/k3_dfu.h
    index 15cd8f262145..134aad5d0e86 100644
    --- a/include/environment/ti/k3_dfu.h
    +++ b/include/environment/ti/k3_dfu.h
    @@ -57,7 +57,7 @@
     
     #define DFU_ALT_INFO_RAM \
            "dfu_alt_info_ram=" \
    -       "tispl.bin ram 0x80080000 0x200000;" \
    +       "tispl.bin ram 0x82200000 0x1800000;" \
            "u-boot.img ram 0x81000000 0x400000\0" \
     
     #define DFU_ALT_INFO_OSPI_NAND \
    

  • Hi Liu,

    I have a question, didn't Falcon boot skip A53 SPL and A53 U-Boot? And tispl.bin binary doesn't belong to the A53 SPL stage? Our board is already able to use DFU in normal boot mode, and I have also modified the DFU-related Python files in Flash Writer, mainly to replace the tispl.bin with atf-tee-dm-kernel-fdt.bin. But Flash Writer will report "Aborting!! Max iterations reached. DFU device not listening for 'atf-tee-dm-kernel-fdt.bin'" error, it seems that the atf-tee-dm-kernel-fdt.bin cannot be recognized. So does TI have a DFU Flash Writer routine for Falcon boot?

  • Hi Hang,

    didn't Falcon boot skip A53 SPL and A53 U-Boot?

    Yes, A53 SPL and A53 U-Boot are skipped in falcon boot.

    And tispl.bin binary doesn't belong to the A53 SPL stage?

    correct. The tispl.bin file I mentioned is basically your atf-tee-dm-kernel-fdt.bin. sorry for the confusion.

    But Flash Writer will report "Aborting!! Max iterations reached. DFU device not listening for 'atf-tee-dm-kernel-fdt.bin'" error, it seems that the atf-tee-dm-kernel-fdt.bin cannot be recognized

    I don't use Flash Writer so don't know what would be the problem. But if your second binary to be transferred is named as "atf-tee-dm-kernel-fdt.bin", you need to define it in DFU_ALT_INFO_RAM variable. So please change my previous patch to:

        env: update location and size in DFU_ALT_INFO_RAM
        
        the location matches CONFIG_SPL_LOAD_FIT_ADDRESS in R5 defconfig;
        the size to hold kernel image and initramfs.
    
    diff --git a/include/environment/ti/k3_dfu.h b/include/environment/ti/k3_dfu.h
    index 15cd8f262145..134aad5d0e86 100644
    --- a/include/environment/ti/k3_dfu.h
    +++ b/include/environment/ti/k3_dfu.h
    @@ -57,7 +57,7 @@
     
     #define DFU_ALT_INFO_RAM \
            "dfu_alt_info_ram=" \
    -       "tispl.bin ram 0x80080000 0x200000;" \
    +       "atf-tee-dm-kernel-fdt.bin ram 0x82200000 0x1800000;" \
            "u-boot.img ram 0x81000000 0x400000\0" \
     
     #define DFU_ALT_INFO_OSPI_NAND \

  • Hi Liu,
    I have tried the method you mentioned yesterday, but the Flash Writer still reported "Aborting!! Max iterations reached. DFU device not listening for 'atf-tee-dm-kernel-fdt. bin' " error. I refer to this section of the SDK documentation for the use of Flash Writer: https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_02_01_10/exports/docs/linux/Foundational_Components/Tools/Flash_via_DFU.html. If you haven't used Flash Writer to implement DFU, what tool did you use to achieve it? I may be able to use it as a reference.

  • Hi Hang,

    I typically used DFU flashing in manual steps, similar to the process described in the link below.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1127618/faq-sk-am62-how-to-flash-emmc-using-usb-dfu-on-am62x-sk-e2

    I don't have the procedure documented for flashing falcon boot images, but I believe you just need the following changes in the process:

    - using the U-Boot patch I provided earlier to modify DFU_ALT_INFO_RAM to ensure the memory buffer is big enough to hold the atf-tee-dm-kernel-fdt.bin file;

    - For the following step in the instruction, please ensure ${dfu_alt_info_emmc} is configured properly for the big atf-tee-dm-kernel-fdt.bin file too.

        At the U-Boot prompt, perform the following two commands. Alternatively, these two u-boot commands may also be built into u-boot.

    • setenv dfu_alt_info ${dfu_alt_info_emmc}
    • dfu 0 mmc 0
  • Hi Bin,

    Bin Liu said:

        At the U-Boot prompt, perform the following two commands. Alternatively, these two u-boot commands may also be built into u-    boot.
    Falcon boot skipped A53 Uboot, can't the Uboot command be used?

    I changed the name of atf-tee-dm-kernel-fdt.bin to tispl.bin, and also changed the k3_dfu. h file as you suggested. I was able to successfully transfer the tiboot3.bin file to the development board, but when I tried to transfer the tispl.bin file, it froze at 8%. Our EMMC boot partition size is 2M, and the tispl.bin file size is 20.5M. I feel that tiboot3.bin and tispl.bin have been transferred to the EMMC boot partition.

    The problem I am currently facing is:
    1. Our Falcon boot is implemented based on EMMC UDA boot mode. Now, we have skipped A53 Uboot and cannot use the Uboot command. How can we implement EMMC GPT partitioning?
    2. How can dfu_util place the firmware in the correct EMMC UDA partition location?

  • Hi Hang,

    Do you use raw or FS mode in UDA?

    If you use FS mode, the instruction linked below shows how to create the UDA FS ext4 raw file (tisdk-base.ext4). You can follow it to create a UDA RAW image file with atf-tee-dm-kernel-fdt.bin in it. I believe the file has to be renamed to tispl.bin, since this is the file which tiboot3.bin looks for in filesystem.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1127618/faq-sk-am62-how-to-flash-emmc-using-usb-dfu-on-am62x-sk-e2

  • Hi Bin,

    Thank you for your guidance. I have implemented the DFU that supports EMMC UDA RAW falcon boot by referring to the link you provided. But when burning DFU, I need two tiboot3.bin files, one for boot and one for flash. I would like to ask, in order to distinguish the two tiboot3.bin files, can the name of the tiboot3.bin file used for flash be changed to tiboot3_flash.bin? After placing the tiboot3_flash.bin file into EMMC, will powering on again affect startup?

  • Hi Hang,

    I would like to ask, in order to distinguish the two tiboot3.bin files, can the name of the tiboot3.bin file used for flash be changed to tiboot3_flash.bin?

    Yes, you can use different name for each of the binary file. tiboot3.bin is in raw format stored in DDR (for boot) or eMMC flash, so the filenames on the PC don't matter.

    After placing the tiboot3_flash.bin file into EMMC, will powering on again affect startup?

    Before power cycle the board after flashing, please ensure the SYSBOOT is switch to eMMC boot mode, and eMMC boot device is configured properly. All the details are described in the E2E FAQ I linked above.