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.

TMDS243EVM: Program TMDS243EVM via USB (usb_bootloader.py) on Ubuntu system is hangs

Part Number: TMDS243EVM
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

I am attempting to program the TMDS243EVM board I have via USB using a Raspberry Pi running Ubuntu 24.04 LTS.

I have installed dfu-util installed and working.

The boot mode switches are set as follows.

A colleague has used usb_bootloader.py to successfully program the EMV with a simple hello world example on a Windows system, but it is hanging for me.

I am using the same image file and arguments as she used on her Windows system. I have not installed CCS on my Raspberry Pi, but I have copied the entire ~/ti/mcu_plus_sdk_am243x_09_01_00_41/tools/boot folder to the Pi and the hello word image.

  

It looks like programming starts by loading the sbl_prebuilt/am243x-evm/sbl_dfu.debug.hs_fs.tiimage file, but fails after that unable to enumerate the DFU.  It will hang there indefinitely unless I power cycle the EVM.

In this example I run the script and when the script hangs "Waiting for DFU device to be enumerated ...." I power cycled the EVM and it continues and finishes the example programming session:

pi@rpi3-desktop-Ubuntu24:~/ccs12-sdk9.01.00.41-tools$ sudo python3 usb_bootloader.py -b sbl_prebuilt/am243x-evm/sbl_dfu.debug.hs_fs.tiimage -i 0 -f hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs
----------------------------------------------------------------
Sending the SBL DFU bootloader sbl_prebuilt/am243x-evm/sbl_dfu.debug.hs_fs.tiimage ...
----------------------------------------------------------------------------
Executing DFU command with alt_setting=0 interface=0 transfer_size=512
----------------------------------------------------------------------------
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Warning: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release
Opening DFU capable USB device...
Device ID 0451:6165
Device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 0110
Device returned transfer size 512
Warning: Overriding device-reported transfer size
Copying data from PC to DFU device
Download	[=========================] 100%       363845 bytes
Download done.
DFU state(6) = dfuMANIFEST-SYNC, status(0) = No error condition is present
DFU state(2) = dfuIDLE, status(0) = No error condition is present
Done!
----------------------------------------------------------------
Sent bootloader sbl_prebuilt/am243x-evm/sbl_dfu.debug.hs_fs.tiimage of size 363845 bytes in 1.9s.
----------------------------------------------------------------

----------------------------------------------------------------
Sending the application hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs ...
------------------------------------------------------
Waiting for DFU device to be enumerated ....
------------------------------------------------------
------------------------------------------------------
Waiting for DFU device to be enumerated ....
------------------------------------------------------
------------------------------------------------------
Waiting for DFU device to be enumerated ....
------------------------------------------------------
------------------------------------------------------
Waiting for DFU device to be enumerated ....
------------------------------------------------------
------------------------------------------------------
Waiting for DFU device to be enumerated ....
------------------------------------------------------
------------------------------------------------------
Waiting for DFU device to be enumerated ....
------------------------------------------------------
----------------------------------------------------------------------------
Executing DFU command with alt_setting=0 interface=0 transfer_size=512
----------------------------------------------------------------------------
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Warning: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release
Opening DFU capable USB device...
Device ID 0451:6165
Device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 0110
Device returned transfer size 512
Warning: Overriding device-reported transfer size
Copying data from PC to DFU device
Download	[=========================] 100%        40298 bytes
Download done.
DFU state(6) = dfuMANIFEST-SYNC, status(0) = No error condition is present
DFU state(2) = dfuIDLE, status(0) = No error condition is present
Done!
----------------------------------------------------------------
Sent application hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs of size 40298 bytes in 1.25s.
----------------------------------------------------------------
pi@rpi3-desktop-Ubuntu24:~/ccs12-sdk9.01.00.41-tools$ 

I am attempting to setup a automated programming tool that will work for our target board (AM243x via USB). Power cycling mid script is a problem.  Automating the power cycling could be a problem.

I would like to get some clear instructions on the API for usb_bootloader.py and usb_dfu_uniflash.py if that will serve my purpose better, but I can't find any documentation for either of these tools.

  • Hello,

    The usage of `usb_bootloader.py` & `usb_dfu_uniflash.py` are described here

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/09_02_00_50/exports/docs/api_guide_am243x/TOOLS_BOOT.html#USB_BOOTLOADER

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/09_02_00_50/exports/docs/api_guide_am243x/TOOLS_FLASH.html#TOOLS_FLASH_DFU_UNIFLASH

    In short,

    • usb_bootloader.py => This script is meant to be used with SBL_DFU to boot an application image directly over USB DFU.
    • usb_dfu_uniflash.py => This script is meant to be used with SBL_DFU_UNIFLASH to flash the different into OSPI at the defined offsets.

    Regards,

    Prashant

  • I need to understand why I had to power cycle the EVM when running the above example of the usb_bootloader.py from my Linux system but did not need to do that with a Windows system.

  • Hello,

    I need to understand why I had to power cycle the EVM when running the above example of the usb_bootloader.py from my Linux system but did not need to do that with a Windows system.

    Could you please capture and share the logs from the both cases?

    Regards,

    Prashant

  • Windows system without power cycle:

    Hong@honzhzha-97VT0T3 MINGW64 /c/ti/mcu_plus_sdk_am243x_09_00_00_35/tools/boot
    $ python usb_bootloader.py -b sbl_prebuilt/am243x-evm/sbl_dfu.debug.hs_fs.tiimage -i 0 -f sbl_prebuilt/hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs
    dfu-util 0.11Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2021 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to http://sourceforge.net/p/dfu-util/tickets/Opening DFU capable USB device...
    Device ID 0451:6165
    Device DFU version 0110
    Claiming USB DFU Interface...
    Setting Alternate Interface #0 ...
    Determining device status...
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    DFU mode device DFU version 0110
    Device returned transfer size 512
    Warning: Overriding device-reported transfer size
    Copying data from PC to DFU device
    Download        [=========================] 100%       317357 bytes
    Download done.
    DFU state(6) = dfuMANIFEST-SYNC, status(0) = No error condition is present
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    Done!
    Warning: Invalid DFU suffix signature
    A valid DFU suffix will be required in a future dfu-util release
    dfu-util 0.11Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2021 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to http://sourceforge.net/p/dfu-util/tickets/Opening DFU capable USB device...
    Device ID 0451:6164
    Device DFU version 0101
    Claiming USB DFU Interface...
    Setting Alternate Interface #0 ...
    Determining device status...
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    DFU mode device DFU version 0101
    Device returned transfer size 512
    Warning: Overriding device-reported transfer size
    Copying data from PC to DFU device
    Download        [=========================] 100%        40298 bytes
    Download done.
    DFU state(7) = dfuMANIFEST, status(0) = No error condition is present
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    Done!
    Warning: Invalid DFU suffix signature
    A valid DFU suffix will be required in a future dfu-util release
    ----------------------------------------------------------------
    Sending the SBL DFU bootloader sbl_prebuilt/am243x-evm/sbl_dfu.debug.hs_fs.tiimage ...
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    ----------------------------------------------------------------
    Sent bootloader sbl_prebuilt/am243x-evm/sbl_dfu.debug.hs_fs.tiimage of size 317357 bytes in 1.87s.
    --------------------------------------------------------------------------------------------------------------------------------
    Sending the application sbl_prebuilt/hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs ...
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    ----------------------------------------------------------------
    Sent application sbl_prebuilt/hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs of size 40298 bytes in 2.61s.
    ----------------------------------------------------------------

    Oracle Linux 8 system required power cycle:

    (p3env) pi@pi4:~/ccs12-sdk9.01.00.41-tools-boot $ sudo python3 usb_bootloader.py -b sbl_prebuilt/am243x-evm/sbl_dfu.debug.hs_fs.tiimage -i 0 -f hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs
    ----------------------------------------------------------------
    Sending the SBL DFU bootloader sbl_prebuilt/am243x-evm/sbl_dfu.debug.hs_fs.tiimage ...
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11
    
    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2021 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
    
    dfu-util: Warning: Invalid DFU suffix signature
    dfu-util: A valid DFU suffix will be required in a future dfu-util release
    Opening DFU capable USB device...
    Device ID 0451:6165
    Device DFU version 0110
    Claiming USB DFU Interface...
    Setting Alternate Interface #0 ...
    Determining device status...
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    DFU mode device DFU version 0110
    Device returned transfer size 512
    Warning: Overriding device-reported transfer size
    Copying data from PC to DFU device
    Download	[=========================] 100%       363845 bytes
    Download done.
    DFU state(6) = dfuMANIFEST-SYNC, status(0) = No error condition is present
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    Done!
    ----------------------------------------------------------------
    Sent bootloader sbl_prebuilt/am243x-evm/sbl_dfu.debug.hs_fs.tiimage of size 363845 bytes in 1.43s.
    ----------------------------------------------------------------
    
    ----------------------------------------------------------------
    Sending the application hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs ...
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ...

    The script will wait indefinitely 

    After power cycle:

    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11
    
    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2021 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
    
    dfu-util: Warning: Invalid DFU suffix signature
    dfu-util: A valid DFU suffix will be required in a future dfu-util release
    Opening DFU capable USB device...
    Device ID 0451:6165
    Device DFU version 0110
    Claiming USB DFU Interface...
    Setting Alternate Interface #0 ...
    Determining device status...
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    DFU mode device DFU version 0110
    Device returned transfer size 512
    Warning: Overriding device-reported transfer size
    Copying data from PC to DFU device
    Download [=========================] 100% 40298 bytes
    Download done.
    DFU state(6) = dfuMANIFEST-SYNC, status(0) = No error condition is present
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    Done!
    ----------------------------------------------------------------
    Sent application hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs of size 40298 bytes in 1.07s.
    ----------------------------------------------------------------

    Are there logs other than capturing the console that I can share?

  • It looks like the issus I am seeing is with the version of the SDK.  If I use the 9.01.00.41 a power cycle is required mid script.  If I use SDK 9.00.00.35 then the power cycle is not required.

  • Hello,

    It looks like the issus I am seeing is with the version of the SDK.

    I do the issue with SBL_DFU from SDK v09_01_00_41 but not with SDK v09_00_00_35. It seems like something changed between the versions that broke the functionality. I will create an internal bug ticket.

    Btw, the power cycling is not solving any issues with SDK v09_01_00_41. It's just that the "usb_bootloader.py" isn't doing what it is supposed to do.

    As I explained previously, the "usb_bootloader.py" script is meant to be used for booting an application image over USB DFU. If the script is ending successfully then you should the SBL_DFU and application logs on the UART0 port if connected.

    You will see these logs with SDK v09_00_00_35 but not with SDK v09_01_00_41 (even thought the script ends successfully).

    INFO: Bootloader_loadSelfCpu:207: CPU r5f0-0 is initialized to 800000000 Hz !!!
    INFO: Bootloader_loadSelfCpu:207: CPU r5f0-1 is initialized to 800000000 Hz !!!
    [BOOTLOADER_PROFILE] Boot Media       : USB DFU
    [BOOTLOADER_PROFILE] Boot Image Size  : 0 KB
    [BOOTLOADER_PROFILE] Cores present    :
    r5f0-0
    r5f0-1
    [BOOTLOADER PROFILE] CPU load                         :      79452us
    [BOOTLOADER_PROFILE] SBL Total Time Taken             :      79452us
    
    Image loading done, switching to application ...
    INFO: Bootloader_runSelfCpu:217: All done, reseting self ...
    
    Hello World!

    Regards,

    Prashant

  • Hi 

    I believe you are still tracking this as an open item for fix. Unfortunately we do not have a schedule yet for this. This will likely come in 11.0 or beyond SDK , which will be in the 2Q time frame or beyond. 

    The developer's view was as follows

    For now can  customer use Release build or disable UART? Does this work for you?

  • Hi Mukul,

    Thanks!  WRT "For now can customer use Release build or disable UART?".. in this case, the UART is not involved.. this is a USB/related issue.

    Thanks, Merril

  • in this case, the UART is not involved.. this is a USB/related issue.

    The UART here is the UART logging from the SBL DFU.

    The recommendation here is to either use the Release build or disable the UART logging of the SBL DFU.

  • Hello,

    We have identified the possible root cause of the issue. The root cause is basically the uninitialization of the ".bss.nocache" section to the default value of 0. Some USB stack related variables are allocated to this section.

    Please try the following patch & let us know if it works for you.

    diff --git a/examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/main.c b/examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/main.c
    index c619d2ad..1d6ae673 100644
    --- a/examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/main.c
    +++ b/examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/main.c
    @@ -150,6 +150,9 @@ int main(void)
             Bootloader_enableMCUPLL();
         }
     
    +    /* Initialize the ".bss.nocache" section to 0 */
    +    memset((void*)0x70050000, 0x0, 0x8000);
    +
         System_init();
     
         Bootloader_socOpenFirewalls();
    

    Regards,

    Prashant

  • Hello Prashant, 

    Thanks a lot for the reply. 

    I checked the sbl_dfu_uniflash from latest SDK 10 release, and it doesn't have this initialization as well. 

    Could you please help us to understand what this fix needs to carry over to the sbl_dfu_uniflash project as well? Even though we have not seen issues using sbl_dfu_uniflash. 

    Thanks, 
    Hong 

  • Hello,

    Could you please help us to understand what this fix needs to carry over to the sbl_dfu_uniflash project as well

    The patch needs to be applied to any application, including SBL_DFU_UNIFLASH, using the USB driver.

    Please confirm if the original issue is resolved after applying the patch so that we can take that as the final fix & merge for the next SDK v11.

    Regards,

    Prashant

  • Hello Prashant, 

    I think the original problem was on the usb_bootloader.py script in SDK 9.01's release.   

    I will test the updated SBL_DFU with the SDK 9.01's release usb_bootloaer.py and let you know shortly. 

    Hong 

  • Hello Prashant, 

    I tested the SBL_DFU (from SDK9.01's release) using the SDK9.01's release usb_bootloader with the only change below added before System_init(), I don't see this changed the test result. It failed the same way as Mark reported above.

    + /* Initialize the ".bss.nocache" section to 0 */
    + memset((void*)0x70050000, 0x0, 0x8000);


    May be you can help to understand what makes you think this is the rootcause and what test have you done to confirm on TI side? 

    Thanks,
    Hong 

  • Hello,

    The root cause is basically the uninitialization of the ".bss.nocache" section to the default value of 0. Some USB stack related variables are allocated to this section.

    As I mentioned here, the following USB related variables are allocated to the ".bss.nocache" section

    https://github.com/TexasInstruments/mcupsdk-core/blob/d0ccb3c8f7bc6b930a7a76f4c70012bbf84968db/source/usb/cdn/soc/am64x_am243x/usb_wrapper.c#L61

    The SDK only initializes the ".bss" section (more specifically the address range __BSS_START to __BSS_END) to the default value 0 which leaves the ".bss.nocache" uninitialized. This may cause the variables to have garbage values possibly causing the issue.

    Here are the failure logs with the default SBL_DFU image:

    ❯ python3 usb_bootloader.py -b ../../examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/ti-arm-clang/sbl_dfu.debug.hs_fs.tiimage -f ../../examples/hello_world/am243x-evm/r5fss0-0_nortos/ti-arm-clang/hello_world.debug.appimage.hs_fs
    ----------------------------------------------------------------
    Sending the SBL DFU bootloader ../../examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/ti-arm-clang/sbl_dfu.debug.hs_fs.tiimage ...
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11
                                                                      
    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2021 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
                                                                      
    Warning: Invalid DFU suffix signature
    A valid DFU suffix will be required in a future dfu-util release
    Opening DFU capable USB device...
    Device ID 0451:6165
    Device DFU version 0110
    Claiming USB DFU Interface...
    Setting Alternate Interface #0 ...
    Determining device status...
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    DFU mode device DFU version 0110
    Device returned transfer size 512
    Warning: Overriding device-reported transfer size
    Copying data from PC to DFU device
    Download        [=========================] 100%       363876 bytes
    Download done.
    DFU state(6) = dfuMANIFEST-SYNC, status(0) = No error condition is present
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    Done!
    ----------------------------------------------------------------
    Sent bootloader ../../examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/ti-arm-clang/sbl_dfu.debug.hs_fs.tiimage of size 363876 bytes in 1.66s.
    ----------------------------------------------------------------
    
    ----------------------------------------------------------------
    Sending the application ../../examples/hello_world/am243x-evm/r5fss0-0_nortos/ti-arm-clang/hello_world.debug.appimage.hs_fs ...
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ^CTraceback (most recent call last):
      File "/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_01_00_41/tools/boot/usb_bootloader.py", line 207, in <module>
        main(sys.argv[1:])
      File "/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_01_00_41/tools/boot/usb_bootloader.py", line 200, in main
        send_status, timetaken = dfu_fw_send(appimage_file, interface ,alt_setting,transfer_size)
      File "/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_01_00_41/tools/boot/usb_bootloader.py", line 61, in dfu_fw_send
        wait_for_enumeration()
      File "/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_01_00_41/tools/boot/usb_bootloader.py", line 48, in wait_for_enumeration
        time.sleep(0.5)
    KeyboardInterrupt

    Here are the successful logs after the patch to initialize the ".bss.nocache" section is applied:

    ❯ python3 usb_bootloader.py -b ../../examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/ti-arm-clang/sbl_dfu.debug.hs_fs.tiimage
    -f ../../examples/hello_world/am243x-evm/r5fss0-0_nortos/ti-arm-clang/hello_world.debug.appimage.hs_fs
    ----------------------------------------------------------------
    Sending the SBL DFU bootloader ../../examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/ti-arm-clang/sbl_dfu.debug.hs_fs.tiimage
    ...
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11
                                                                                                                                           
    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2021 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
                                                                                                                                           
    Warning: Invalid DFU suffix signature
    A valid DFU suffix will be required in a future dfu-util release
    Opening DFU capable USB device...
    Device ID 0451:6165
    Device DFU version 0110
    Claiming USB DFU Interface...
    Setting Alternate Interface #0 ...
    Determining device status...
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    DFU mode device DFU version 0110
    Device returned transfer size 512
    Warning: Overriding device-reported transfer size
    Copying data from PC to DFU device
    Download        [=========================] 100%       363892 bytes
    Download done.
    DFU state(6) = dfuMANIFEST-SYNC, status(0) = No error condition is present
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    Done!
    ----------------------------------------------------------------
    Sent bootloader ../../examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/ti-arm-clang/sbl_dfu.debug.hs_fs.tiimage of size 363892
    bytes in 1.65s.
    ----------------------------------------------------------------
                                                                                                                                           
    ----------------------------------------------------------------
    Sending the application ../../examples/hello_world/am243x-evm/r5fss0-0_nortos/ti-arm-clang/hello_world.debug.appimage.hs_fs ...
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11
                                                                                                                                           
    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2021 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
                                                                                                                                           
    Warning: Invalid DFU suffix signature
    A valid DFU suffix will be required in a future dfu-util release
    Opening DFU capable USB device...
    Device ID 0451:6164
    Device DFU version 0101
    Claiming USB DFU Interface...
    Setting Alternate Interface #0 ...
    Determining device status...
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    DFU mode device DFU version 0101
    Device returned transfer size 512
    Warning: Overriding device-reported transfer size
    Copying data from PC to DFU device
    Download        [=========================] 100%        87774 bytes
    Download done.
    DFU state(7) = dfuMANIFEST, status(0) = No error condition is present
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    Done!
    ----------------------------------------------------------------
    Sent application ../../examples/hello_world/am243x-evm/r5fss0-0_nortos/ti-arm-clang/hello_world.debug.appimage.hs_fs of size 87774 bytes in 3.9s.
    ----------------------------------------------------------------

    If the patch didn't work for you, please share the failure logs & the SBL DFU image as well for me to test locally on TI EVM.

    Regards,

    Prashant

  • Hello Prashant, 

    After adding the patch, I got exact the same log as above posted by Mark.  I use SDK 09.01.00.41 release, and I didn't see this issue on SDK 09.00.00.35's release on the same setup. And I don't see this cache initialization on the SDK 09.00.00.35's SBL_DFU code as well. So I am not sure about why you saw different results as above. 

    $ python usb_bootloader.py -b sbl_dfu_add_cache_init.Debug.hs_fs.tiimage -i 0 -f hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs
    dfu-util 0.11
    
    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2021 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
    
    Opening DFU capable USB device...
    Device ID 0451:6165
    Device DFU version 0110
    Claiming USB DFU Interface...
    Setting Alternate Interface #0 ...
    Determining device status...
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    DFU mode device DFU version 0110
    Device returned transfer size 512
    Warning: Overriding device-reported transfer size
    Copying data from PC to DFU device
    Download        [=========================] 100%       363892 bytes
    Download done.
    DFU state(6) = dfuMANIFEST-SYNC, status(0) = No error condition is present
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    Done!
    Warning: Invalid DFU suffix signature
    A valid DFU suffix will be required in a future dfu-util release
    ----------------------------------------------------------------
    Sending the SBL DFU bootloader sbl_dfu_add_cache_init.Debug.hs_fs.tiimage ...
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    ----------------------------------------------------------------
    Sent bootloader sbl_dfu_add_cache_init.Debug.hs_fs.tiimage of size 363892 bytes in 1.83s.
    ----------------------------------------------------------------
    
    ----------------------------------------------------------------
    Sending the application hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs ...
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....

  • Hello Prashant, 

    I tried to upload the image, but it doesn't allow me to post it on e2e channel.  Please advise what is the allowable file format here for sharing. 

    Thanks, 
    Hong 

  • Hi Hong,

    I didn't see this issue on SDK 09.00.00.35's release on the same setup. And I don't see this cache initialization on the SDK 09.00.00.35's SBL_DFU code as well.

    It was just luckily working previously.

    The following patch would reproduce the issue even in the luckily working SDK v09.00.00.35

    diff --git a/examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/main.c b/examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/main.c
    index cd2c61d..25340d0 100644
    --- a/examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/main.c
    +++ b/examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/main.c
    @@ -115,6 +115,13 @@ int dfu_task(void)
         return 0;
     }
     
    +uint8_t garr[0x10000] = {5};
    +
    +void test_func()
    +{
    +    DebugP_log("garr[0]: %d\r\n", garr[0]);
    +}
    +
     int main(void)
     {
         int32_t status = SystemP_SUCCESS;
    @@ -161,6 +168,8 @@ int main(void)
     
         DebugP_assert(status == SystemP_SUCCESS);
     
    +    test_func();
    +
     
         /* exit once DFU download is completed */
         dfu_task() ;
    

    Here are the failure logs after this patch:

    ❯ pwd
    /home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/tools/boot
    ❯ python3 usb_bootloader.py -b ../../examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/ti-arm-clang/sbl_dfu.debug.hs_fs.tiimage -f ../../examples/drivers/ipc/ipc_rpmsg_echo/am243x-evm/system_freertos_nortos/ipc_rpmsg_echo_system.debug.appimage.hs_fs
    ----------------------------------------------------------------
    Sending the SBL DFU bootloader ../../examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/ti-arm-clang/sbl_dfu.debug.hs_fs.tiimage
    ...
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11
                                                                                                                                           
    Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
    Copyright 2010-2021 Tormod Volden and Stefan Schmidt
    This program is Free Software and has ABSOLUTELY NO WARRANTY
    Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
                                                                                                                                           
    Warning: Invalid DFU suffix signature
    A valid DFU suffix will be required in a future dfu-util release
    Opening DFU capable USB device...
    Device ID 0451:6165
    Device DFU version 0110
    Claiming USB DFU Interface...
    Setting Alternate Interface #0 ...
    Determining device status...
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    DFU mode device DFU version 0110
    Device returned transfer size 512
    Warning: Overriding device-reported transfer size
    Copying data from PC to DFU device
    Download        [=========================] 100%       382988 bytes
    Download done.
    DFU state(6) = dfuMANIFEST-SYNC, status(0) = No error condition is present
    DFU state(2) = dfuIDLE, status(0) = No error condition is present
    Done!
    ----------------------------------------------------------------
    Sent bootloader ../../examples/drivers/boot/sbl_dfu/am243x-evm/r5fss0-0_nortos/ti-arm-clang/sbl_dfu.debug.hs_fs.tiimage of size 382988
    bytes in 1.67s.
    ----------------------------------------------------------------
                                                                                                                                           
    ----------------------------------------------------------------
    Sending the application ../../examples/drivers/ipc/ipc_rpmsg_echo/am243x-evm/system_freertos_nortos/ipc_rpmsg_echo_system.debug.appimage.hs_fs ...
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ^CTraceback (most recent call last):
      File "/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/tools/boot/usb_bootloader.py", line 207, in <module>
        main(sys.argv[1:])
      File "/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/tools/boot/usb_bootloader.py", line 200, in main
        send_status, timetaken = dfu_fw_send(appimage_file, interface ,alt_setting,transfer_size)
      File "/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/tools/boot/usb_bootloader.py", line 61, in dfu_fw_send
        wait_for_enumeration()
      File "/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/tools/boot/usb_bootloader.py", line 48, in wait_for_enumeration
        time.sleep(0.5)
    KeyboardInterrupt

    The uninitialization of the ".bss.nocache" is indeed the root cause of the issue here so the previous patch should fix the issue.

    I tried to upload the image, but it doesn't allow me to post it on e2e channel.

    You may zip the images & share the generated zip file. Please also share the SBL DFU .out, .map files as well.

    Regards,

    Prashant

  • Hello Prashant, 

    Thanks for the explanation.  

    I found the issues on my side.  For some reason, I could not access e2e channel on my PC lately that is what I use to build binary and connect to the EVM.

    I manually typed the address and mis-typed memset((void*)0x70050000, 0x0, 0x8000); to  memset((void*)0x70060000, 0x0, 0x8000);

    After I corrected the address to use:

    memset((void*)0x70050000, 0x0, 0x8000);

    The issue did fix on SDK 9.1 version's SBL_DFU. I will add this in our SBL_DFU_UNIFLASH as well. 

    Thanks again, 
    Hong 

  • The issue did fix on SDK 9.1 version's SBL_DFU. I will add this in our SBL_DFU_UNIFLASH as well.

    Thanks for the confirmation, Hong. We will update the internal ticket to take this fix & merge in the next SDK release v11.0.

    Closing this long standing thread finally!!