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.

MCU-PLUS-SDK-AM243X: Is there a way to use usb_bootloader.py with more than one device connected to the host for programming

Part Number: MCU-PLUS-SDK-AM243X
Other Parts Discussed in Thread: UNIFLASH, TMDS243EVM

Tool/software:

The script usb_bootloader.py has options --interface and --alt-setting that I find no real documentation for (see https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/09_02_00_50/exports/docs/api_guide_am243x/TOOLS_BOOT.html#USB_BOOTLOADER).

I am looking to use a Linux system in our factory to program our AM243x boards using usb_bootloader.py Is there a way to have more than one board connected to the host system via USB and program more than one  at a time, each from its own process/shell?  Does the usb_bootloader.py option --interface help with that?  I think that I can identify multiple devices using lsusb command and power cycling the device I want to use, but I still need to call it out via the script.

  • Hello,

    e2e.ti.com/.../5326532

    As explained in your other thread, the "usb_bootloader.py" is for booting application over USB DFU. It does not program anything anywhere. Please clarify that you mean to use `usb_dfu_uniflash.py` with SBL_DFU_UNIFLASH for flashing images to OSPI & not `usb_bootloader.py`?

    Regards,

    Prashant

  • From the first line of your usb_bootloader.py documentation found here.

    "This script is used in DFU boot mode for sending the SBL and appimage binaries to the EVM via USB DFU."

    I agree that I am not programming the AM243x part I am sending my bootloader and application to the board via USB so that I can boot this code.  I can successfully send my bootloader and app to an EVM board or our own board using usb_bootloader.py.  What I am looking for is a way to distinguish one of multiple boards that may be connected to the host running the usb_bootloader.py script. 

    Using dfu_util I can see two devices in this example:

    $ sudo dfu-util -l
    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/
    
    Found DFU: [0451:6165] ver=0200, devnum=16, cfg=1, intf=0, path="1-1.1.2", alt=1, name="SocId", serial="01.00.00.00"
    Found DFU: [0451:6165] ver=0200, devnum=16, cfg=1, intf=0, path="1-1.1.2", alt=0, name="bootloader", serial="01.00.00.00"
    Found DFU: [0451:6165] ver=0200, devnum=17, cfg=1, intf=0, path="1-1.3", alt=1, name="SocId", serial="01.00.00.00"
    Found DFU: [0451:6165] ver=0200, devnum=17, cfg=1, intf=0, path="1-1.3", alt=0, name="bootloader", serial="01.00.00.00"
    $ lsusb
    Bus 001 Device 025: ID 0451:6165 Texas Instruments, Inc. AM64x DFU
    Bus 001 Device 004: ID 0403:6010 Future Technology Devices International, Ltd FT2232C/D/H Dual UART/FIFO IC
    Bus 001 Device 024: ID 0451:6165 Texas Instruments, Inc. AM64x DFU
    Bus 001 Device 006: ID 0424:7800 Microchip Technology, Inc. (formerly SMSC) 
    Bus 001 Device 003: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
    Bus 001 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    It looks like both of the devices are showing up with "intf=0", which I don't know if that is related to the "--interface" switch of usb_bootloader.py or not.  If so then I won't be able to call out one vs the other when running the script using that argument.  I would like to be able to run usb_bootloader.py against one of multiple boards.  Is there a way for me to do that?

  • Hi Mark,

    The interface & alt alone cannot uniquely identify a device. If multiple devices are connected, they will all expose the same interface & alt settings. The way to uniquely identify the devices to use their USB paths (path=*) assigned to them in the output of the `dfu-util`.

    We have the parallel DFU flash writer for AM64/AM62 family of devices based on U-Boot which makes use of this path to uniquely identify & parallely program them.

    https://git.ti.com/cgit/processor-sdk/uboot-flash-writer/tree/tools/DFU_flash/src/flash.py#n97

    You may take reference from it & modify the `usb_bootloader.py` accordingly.

    For instance, the modified script may vaguely have the following diff. The diff is not tested. So, you may have to modify one or two things to get it working.

    diff --git a/tools/boot/usb_bootloader.py b/tools/boot/usb_bootloader.py
    index 29abbf89..8ad98a87 100644
    --- a/tools/boot/usb_bootloader.py
    +++ b/tools/boot/usb_bootloader.py
    @@ -13,6 +13,8 @@ USAGE: python usb_bootloader.py [OPTIONS]
     
     [optional args]
     
    +-p, --path           USB DFU path
    +
     -i, --interface      USB DFU interface number
                          Default = 0
     
    @@ -50,7 +52,7 @@ def wait_for_enumeration():
         temp_file.close()
         os.remove('temp_file')
     
    -def dfu_fw_send(filename,intf=0,alt=0,xfer_size=512,reset_req=False):
    +def dfu_fw_send(filename,path=0,intf=0,alt=0,xfer_size=512,reset_req=False):
         status = False
         timetaken = 0
         if not os.path.exists(filename):
    @@ -67,9 +69,9 @@ def dfu_fw_send(filename,intf=0,alt=0,xfer_size=512,reset_req=False):
     
         if(reset_req == False):
     
    -        cmd = "dfu-util -a {0} -i {1} -t {2} -D {3}".format(alt,intf,xfer_size,filename)
    +        cmd = "dfu-util -p {4} -a {0} -i {1} -t {2} -D {3}".format(alt,intf,xfer_size,filename,path)
         else:
    -        cmd = "dfu-util -a {0} -i {1} -t {2} -R -D {3}".format(alt,intf,xfer_size,filename)
    +        cmd = "dfu-util -p {4} -a {0} -i {1} -t {2} -R -D {3}".format(alt,intf,xfer_size,filename,path)
     
         try:
             tstart = time.time()
    @@ -104,7 +106,7 @@ def main(argv):
         transfer_size = 512
     
         try:
    -        opts, args = getopt.getopt(argv,"hf:b:i:a:t:",["help", "file=","bootloader=","interface=","alt-setting=","transfer-size="])
    +        opts, args = getopt.getopt(argv,"hf:b:p:i:a:t:",["help", "file=","bootloader=","path=","interface=","alt-setting=","transfer-size="])
         except getopt.GetoptError:
             help()
             sys.exit()
    @@ -118,6 +120,15 @@ def main(argv):
                 bootloader_file = arg
             elif opt in ("-p", "--serial-port"):
                 serialport = arg
    +
    +        elif opt in ("-p", "--path"):
    +            try:
    +                path = int(arg)
    +            except ValueError :
    +                print("[ERROR] --path , -p should be USB DFU path")
    +                help()
    +                sys.exit()
    +
             elif opt in ("-i", "--interface"):
                 try:
                     interface = int(arg)
    @@ -187,7 +198,7 @@ def main(argv):
             print("----------------------------------------------------------------")
             print("Sending the SBL DFU bootloader {} ...".format(bootloader_file))
     
    -        send_status, timetaken = dfu_fw_send(bootloader_file, interface ,alt_setting,transfer_size)
    +        send_status, timetaken = dfu_fw_send(bootloader_file, path, interface ,alt_setting,transfer_size)
     
             print("----------------------------------------------------------------")
             print("Sent bootloader {} of size {} bytes in {}s.".format(bootloader_file, os.path.getsize(bootloader_file), timetaken))
    @@ -197,7 +208,7 @@ def main(argv):
             print("----------------------------------------------------------------")
             print("Sending the application {} ...".format(appimage_file))
     
    -        send_status, timetaken = dfu_fw_send(appimage_file, interface ,alt_setting,transfer_size)
    +        send_status, timetaken = dfu_fw_send(appimage_file, path, interface ,alt_setting,transfer_size)
     
             print("----------------------------------------------------------------")
             print("Sent application {} of size {} bytes in {}s.".format(appimage_file, os.path.getsize(appimage_file), timetaken))
    

    PS: I am not convinced if you really mean to use `usb_bootloader.py`. If you are looking for programming (flashing) then you should be using `usb_dfu_uniflash.py`. If you have happen to use it, the above description remains the same.

    Regards,

    Prashant

  • Prashant,

    I think I got that to work, but I need to get another board to test against to be sure. Thanks.

  • Prashant,

    I now have two TMDS243EVM connected to my Oracle Linux 8 Intel system.  I have used modified versions of both usb_dfu_uniflash.py and usb_bootloader.py per your instructions above with the following results.

    I am using mcu_plus_sdk_am243x_09_00_00_35 for my testing.

    Both system enumerate via dfu-util with both EVM powered up.

    $ sudo dfu-util -l
    dfu-util 0.11-dev
    
    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/
    
    Found DFU: [0451:6165] ver=0200, devnum=20, cfg=1, intf=0, path="1-13", alt=0, name="bootloader", serial="01.00.00.00"
    Found DFU: [0451:6165] ver=0200, devnum=20, cfg=1, intf=0, path="1-13", alt=1, name="SocId", serial="01.00.00.00"
    Found DFU: [0451:6165] ver=0200, devnum=21, cfg=1, intf=0, path="1-11", alt=0, name="bootloader", serial="01.00.00.00"
    Found DFU: [0451:6165] ver=0200, devnum=21, cfg=1, intf=0, path="1-11", alt=1, name="SocId", serial="01.00.00.00"

    If both systems are powered up when attempting to run usb_dfu_uniflash.py on either board it fails as follows for both EVM. This failure happens even if I am not trying to program both boards at once - programming them serially.

    $ sudo python3 usb_dfu_uniflash.py --cfg default_dfu_ospi_debug.cfg -p "1-13"
    
    Parsing config file ...
    Parsing config file ... SUCCESS. Found 4 command(s) !!!
    
    Executing command 1 of 4 ...
    Found flash writer ... sending sbl_dfu_uniflash.debug.hs_fs.tiimage
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11-dev
    
    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%       393045 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 flashwriter sbl_dfu_uniflash.debug.hs_fs.tiimage of size 393045 bytes in 1.56s. Bandwidth = 246.05kbps
    
    Executing command 2 of 4 ...
    Command arguments : --operation=flash-phy-tuning-data
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11-dev
    
    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
    dfu-util: No DFU capable USB device available
    
    [ERROR] DFU fw  send failed, no response OR incorrect response from EVM OR cancelled by user,
    Power cycle EVM and run this script again !!!

    If only one of the two EVM are powered up then things seem to work.

    $ sudo python3 usb_dfu_uniflash.py --cfg default_dfu_ospi_debug.cfg -p "1-11"
    
    Parsing config file ...
    Parsing config file ... SUCCESS. Found 4 command(s) !!!
    
    Executing command 1 of 4 ...
    Found flash writer ... sending sbl_dfu_uniflash.debug.hs_fs.tiimage
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11-dev
    
    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%       393045 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 flashwriter sbl_dfu_uniflash.debug.hs_fs.tiimage of size 393045 bytes in 1.53s. Bandwidth = 250.87kbps
    
    Executing command 2 of 4 ...
    Command arguments : --operation=flash-phy-tuning-data
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11-dev
    
    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:6166
    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%           32 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 flash phy tuning data in 1.02s.
    True
    Executing command 3 of 4 ...
    Command arguments : --file=sbl_ospi.debug.hs_fs.tiimage --operation=flash --flash-offset=0x0
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11-dev
    
    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:6166
    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%       373101 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 sbl_ospi.debug.hs_fs.tiimage of size 373069 bytes in 4.57s. Bandwidth = 79.72kbps
    True
    Executing command 4 of 4 ...
    Command arguments : --file=hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs --operation=flash --flash-offset=0x80000
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    dfu-util 0.11-dev
    
    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:6166
    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%        40330 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 hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs of size 40298 bytes in 1.26s. Bandwidth = 31.23kbps
    True
    All commands from config file are executed !!!

    My config file (comments and blank lines removed):

    $ cat default_dfu_ospi_debug.cfg 
    --flash-writer=sbl_dfu_uniflash.debug.hs_fs.tiimage
    --operation=flash-phy-tuning-data
    --file=sbl_ospi.debug.hs_fs.tiimage --operation=flash --flash-offset=0x0
    --file=hello_world_am243x-evm_r5fss0-0_nortos_ti-arm-clang.appimage.hs_fs --operation=flash --flash-offset=0x80000

    I can provide you with the modified version of usb_dfu_uniflash.py if you would like.

    1. Is this a known issue?
    2. Is there a plan to fix this issue or is it fixed in a newer version of the SDK?
  • Hi Mark,

    I did not test the diff I shared previously because of the unavailabiity of the resources at that time. That's why I said you may need to additionally modify one or two things to make it work.

    As it happens, the diff did not include modifications to the "dfu-util" command in the "wait_for_enumeration" function which I think you also missed & that's the cause of the issue.

    Following is tested diff for "usb_dfu_uniflash.py":

    diff --git a/tools/boot/usb_dfu_uniflash.py b/tools/boot/usb_dfu_uniflash.py
    index 982d55b..5fe050d 100644
    --- a/tools/boot/usb_dfu_uniflash.py
    +++ b/tools/boot/usb_dfu_uniflash.py
    @@ -51,6 +51,9 @@ and then the script can be called:
     python usb_dfu_uniflash.py -p <COM port> --cfg=myconfig.cfg
     '''
     
    +# USB DFU path
    +path = 0
    +
     def get_numword(s):
         numword = None
         if(s.startswith('0x')):
    @@ -144,7 +147,8 @@ def create_temp_file(linecfg):
     def wait_for_enumeration():
     
         enum_done = False
    -    ls_dfu = "dfu-util -l"
    +    ls_dfu = f"dfu-util -l -p {path}"
    +    print(f">>> {ls_dfu}")
         # To print banner that waiting for DFU enumeration 
         flag = False
         while enum_done == False:
    @@ -167,7 +171,7 @@ def wait_for_enumeration():
         temp_file.close()
         os.remove('temp_file')
     
    -def dfu_fw_send(filename,intf=0,alt=0,xfer_size=512,isFlashWriter=False):
    +def dfu_fw_send(filename,path,intf=0,alt=0,xfer_size=512,isFlashWriter=False):
         status = False
         timetaken = 0
         if not os.path.exists(filename):
    @@ -181,7 +185,8 @@ def dfu_fw_send(filename,intf=0,alt=0,xfer_size=512,isFlashWriter=False):
         print("----------------------------------------------------------------------------")
         print("Executing DFU command with alt_setting={0} interface={1} transfer_size={2}".format(alt,intf,xfer_size))
         print("----------------------------------------------------------------------------")
    -    cmd = "dfu-util -a {0} -i {1} -t {2} -D {3}".format(alt,intf,xfer_size,filename)
    +    cmd = "dfu-util -p {4} -a {0} -i {1} -t {2} -D {3}".format(alt,intf,xfer_size,filename,path)
    +    print(f">>> {cmd}")
         try:
             tstart = time.time()
             dfu_status = os.system(cmd)
    @@ -239,7 +244,7 @@ def send_file_by_parts(l_cfg):
             # send the partial file normally
             tempfilename = create_temp_file(l_cfg)
     
    -        status, timetaken = dfu_fw_send(tempfilename,intf_num,alt_setting,xfer_size)
    +        status, timetaken = dfu_fw_send(tempfilename,path,intf_num,alt_setting,xfer_size)
     
             print("Time Elapsed = {}".format(timetaken))
             total_time_taken += timetaken
    @@ -271,7 +276,7 @@ def send_file_by_parts(l_cfg):
     
             # send the partial file normally
             tempfilename = create_temp_file(l_cfg)
    -        status, timetaken = dfu_fw_send(tempfilename,intf_num,alt_setting,xfer_size)
    +        status, timetaken = dfu_fw_send(tempfilename,path,intf_num,alt_setting,xfer_size)
             print("Time Elapsed = {}".format(timetaken))
             total_time_taken += timetaken
     
    @@ -304,6 +309,7 @@ def main(argv):
         my_parser.add_argument('--flash-writer', required=False, help="Special option. This will load the sbl_dfu_uniflash binary which will be booted by ROM. Other arguments are irrelevant and hence ignored when --flash-writer argument is present. Not required if using config mode (--cfg)")
         my_parser.add_argument('--erase-size', required=False, help='Size of flash to erase. Only valid when operation is "erase"')
         my_parser.add_argument('--cfg', required=False, help=g_cfg_file_description)
    +    my_parser.add_argument('-p', '--path', required=True, help="dfu-util enumerated USB DFU path of the device")
     
         args = my_parser.parse_args()
     
    @@ -318,6 +324,9 @@ def main(argv):
         if args.transfer_size is not None:
             cmdlinecfg.xfer_size = args.transfer_size
     
    +    global path
    +    path = args.path
    +
         cmdlinecfg.filename = args.file
         cmdlinecfg.offset = args.flash_offset
         cmdlinecfg.optype = args.operation
    @@ -355,7 +364,7 @@ def main(argv):
                     print("Found flash writer ... sending {}".format(cfg_flash_writer_file))
     
                     # send flash writer via DFU
    -                status, timetaken = dfu_fw_send(cfg_flash_writer_file,intf_num,alt_setting, xfer_size,isFlashWriter = True)
    +                status, timetaken = dfu_fw_send(cfg_flash_writer_file,path,intf_num,alt_setting, xfer_size,isFlashWriter = True)
     
                     bandwidth = (os.path.getsize(cfg_flash_writer_file)/1024)/timetaken
                     print("Sent flashwriter {} of size {} bytes in {}s. Bandwidth = {:0.2f}kbps".format(cfg_flash_writer_file, os.path.getsize(cfg_flash_writer_file), timetaken,bandwidth))
    @@ -381,7 +390,7 @@ def main(argv):
                             # Send normally
                             tempfilename = create_temp_file(linecfg)
     
    -                        status, timetaken = dfu_fw_send(tempfilename,linecfg.intf_num,linecfg.alt_setting,linecfg.xfer_size)
    +                        status, timetaken = dfu_fw_send(tempfilename,path,linecfg.intf_num,linecfg.alt_setting,linecfg.xfer_size)
     
                         orig_filename = linecfg.filename
                         if(linecfg.optype == "erase"):
    @@ -414,7 +423,7 @@ def main(argv):
             # If flash writer was found, send it first
             if(cmdlinecfg.found_flashwriter_cmd == True):
                 print("Found flash writer ... sending {}".format(cmdlinecfg.flashwriter))
    -            status, timetaken = dfu_fw_send(cmdlinecfg.flashwriter,intf_num, alt_setting,xfer_size,isFlashWriter=True)
    +            status, timetaken = dfu_fw_send(cmdlinecfg.flashwriter,path,intf_num, alt_setting,xfer_size,isFlashWriter=True)
                 print("Sent flashwriter {} of size {} bytes in {}s.".format(cmdlinecfg.flashwriter, os.path.getsize(cmdlinecfg.flashwriter), timetaken))
                 print("")
     
    @@ -430,7 +439,7 @@ def main(argv):
                 else:
                     # Send normally
                     tempfilename = create_temp_file(cmdlinecfg)
    -                status, timetaken = dfu_fw_send(tempfilename,intf_num, alt_setting,xfer_size)
    +                status, timetaken = dfu_fw_send(tempfilename,path,intf_num, alt_setting,xfer_size)
                     # Delete the tempfile if it exists
                     if(os.path.exists(tempfilename)):
                         os.remove(tempfilename)
    

    Attached are the relevant logs:

    ❯ dfu-util -l
    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/
    
    Found DFU: [0451:6165] ver=0200, devnum=60, cfg=1, intf=0, path="1-7.2", alt=1, name="SocId", serial="01.00.00.00"
    Found DFU: [0451:6165] ver=0200, devnum=60, cfg=1, intf=0, path="1-7.2", alt=0, name="bootloader", serial="01.00.00.00"
    Found DFU: [0451:6165] ver=0200, devnum=56, cfg=1, intf=0, path="1-7.3", alt=1, name="SocId", serial="01.00.00.00"
    Found DFU: [0451:6165] ver=0200, devnum=56, cfg=1, intf=0, path="1-7.3", alt=0, name="bootloader", serial="01.00.00.00"

    Parsing config file ...
    Parsing config file ... SUCCESS. Found 5 command(s) !!!
    
    Executing command 1 of 5 ...
    Found flash writer ... sending sbl_prebuilt/am243x-evm/sbl_dfu_uniflash.debug.hs_fs.tiimage
    >>> dfu-util -l -p 1-7.2
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    >>> dfu-util -p 1-7.2 -a 0 -i 0 -t 512 -D sbl_prebuilt/am243x-evm/sbl_dfu_uniflash.debug.hs_fs.tiimage
    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%       393045 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 flashwriter sbl_prebuilt/am243x-evm/sbl_dfu_uniflash.debug.hs_fs.tiimage of size 393045 bytes in 1.64s. Bandwidth = 234.04kbps
    
    Executing command 2 of 5 ...
    Command arguments : --operation=flash-phy-tuning-data
    >>> dfu-util -l -p 1-7.2
    ------------------------------------------------------
    Waiting for DFU device to be enumerated ....
    ------------------------------------------------------
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    >>> dfu-util -p 1-7.2 -a 0 -i 0 -t 512 -D flash-phy-tuning-data_command
    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:6166
    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%           32 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 flash phy tuning data in 1.17s.
    True
    Executing command 3 of 5 ...
    Command arguments : --file=sbl_prebuilt/am243x-evm/sbl_ospi.debug.hs_fs.tiimage --operation=flash --flash-offset=0x0
    >>> dfu-util -l -p 1-7.2
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    >>> dfu-util -p 1-7.2 -a 0 -i 0 -t 512 -D sbl_prebuilt/am243x-evm/sbl_ospi.debug.hs_fs.tiimage.tmp
    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:6166
    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%       373101 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 sbl_prebuilt/am243x-evm/sbl_ospi.debug.hs_fs.tiimage of size 373069 bytes in 14.41s. Bandwidth = 25.28kbps
    True
    Executing command 4 of 5 ...
    Command arguments : --file=../../examples/drivers/ipc/ipc_notify_echo/am243x-evm/system_freertos_nortos/ipc_notify_echo_system.debug.appimage.hs_fs --operation=flash --flash-offset=0x80000
    >>> dfu-util -l -p 1-7.2
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    >>> dfu-util -p 1-7.2 -a 0 -i 0 -t 512 -D ../../examples/drivers/ipc/ipc_notify_echo/am243x-evm/system_freertos_nortos/ipc_notify_echo_system.debug.appimage.hs_fs.tmp
    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:6166
    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%       181131 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 ../../examples/drivers/ipc/ipc_notify_echo/am243x-evm/system_freertos_nortos/ipc_notify_echo_system.debug.appimage.hs_fs of size 181099 bytes in 7.0s. Bandwidth = 25.26kbps
    True
    Executing command 5 of 5 ...
    Command arguments : --file=../../examples/drivers/ipc/ipc_notify_echo/am243x-evm/system_freertos_nortos/ipc_notify_echo_system.debug.appimage_xip --operation=flash-xip
    >>> dfu-util -l -p 1-7.2
    ----------------------------------------------------------------------------
    Executing DFU command with alt_setting=0 interface=0 transfer_size=512
    ----------------------------------------------------------------------------
    >>> dfu-util -p 1-7.2 -a 0 -i 0 -t 512 -D ../../examples/drivers/ipc/ipc_notify_echo/am243x-evm/system_freertos_nortos/ipc_notify_echo_system.debug.appimage_xip.tmp
    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:6166
    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%          196 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 ../../examples/drivers/ipc/ipc_notify_echo/am243x-evm/system_freertos_nortos/ipc_notify_echo_system.debug.appimage_xip of size 164 bytes in 1.16s. Bandwidth = 0.14kbps
    True
    All commands from config file are executed !!!

    As for the "Is this a known issue", please note DFU scripts in the SDK does not support flashing/booting multiple devices or single device out of the multiple devices. So, these are more of "missing features" in the scripts.

    The team will evaluate if these are to be included based on the requirements. And we already have the requirement from Oracle to enable the parallel flashing feature in the scripts.

    Regards,

    Prashant

  • Prashant,

    Thanks, it looks like the line I missed was in wait_for_enumeration() to get the info for the specific device (ls_dfu = f"dfu-util -l -p {path}).  This looks like it is going to work for me now.  Again thank you.