Computer environment: Intel desktop computer running Oracle Linux 9.4 UEK
dfu-version: dfu-util 0.11-dev
device: TI AM243x
outptut from 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 https://sourceforge.net/p/dfu-util/tickets/
Found DFU: [0451:6165] ver=0200, devnum=89, cfg=1, intf=0, path="3-6", alt=0, name="bootloader", serial="01.00.00.00"
Found DFU: [0451:6165] ver=0200, devnum=89, cfg=1, intf=0, path="3-6", alt=1, name="SocId", serial="01.00.00.00"
command line:
sudo dfu-util -a 0 -i 0 -D <firmware file> -p 3-6 -vvv
I am running dfu-util to program multiple AM243x MCU that are connected to the same system (5 is my current test set, but I want to double or triple the number of target devices). About 75% of the time this command runs with no errors. 25% of the time it hangs with no indication as to the failure.
21:04:47 428 [INFO] Script start ----------------------------------------
core:main:1082, core:invoke:1697, core:invoke:1697, core:invoke:1443, core:invoke:788, am243x:program_am243x:269, am243x:_program_rtm:228, am243x:_usb_program_rtm:88
21:05:47 492 [ERROR] Script failed with timeout - Command '['python3', '/home/markwar/workspaces/calamari/calamari/am243x/usb_dfu_uniflash.py', '--cfg', '/home/markwar/workspaces/calamari/tmp_prgm_3-6_ttyUSB4.cfg', '-p', '3-6']' timed out after 60.0 seconds
21:05:47 492 [INFO] Results of script:
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 https://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
Copying data from PC to DFU device
Download [ ] 0% 0 bytes
Download [= ] 4% 14336 bytes
Download [== ] 8% 28160 bytes
Download [=== ] 12% 42496 bytes
Download [==== ] 16% 56320 bytes
Download [===== ] 20% 70656 bytes
Download [====== ] 24% 84480 bytes
Download [======= ] 28% 98816 bytes
Download [======== ] 32% 112640 bytes
Download [========= ] 36% 126976 bytes
Download [========== ] 40% 140800 bytes
Download [=========== ] 44% 155136 bytes
Download [============ ] 48% 168960 bytes
Download [============= ] 52% 183296 bytes
Download [============= ] 53% 188416 bytes
Download [============== ] 56% 197120 bytes
Download [=============== ] 60% 210944 bytes
Download [================ ] 64% 225280 bytes
Download [================= ] 68% 239104 bytes
Download [================== ] 72% 253440 bytes
Download [=================== ] 76% 267264 bytes
Download [==================== ] 80% 281600 bytes
Download [===================== ] 84% 295424 bytes
Download [====================== ] 88% 309760 bytes
Download [======================= ] 92% 323584 bytes
Download [======================== ] 96% 337920 bytes
Download [=========================] 100% 351004 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!
21:05:47 492 [INFO] Script end (/home/markwar/workspaces/calam) ----------------------------------------
21:05:47 493 [WARNING] Failed Erase and Program AM243x RTM on attempt 1 of 3
This step in the Python script I use to execute usually only takes 26-28 seconds. and doesn't timeout until 60 seconds.
I have tried to put a fcnt.flock around the dfu-util call so that only one device is going through this step at a time, but that hasn't fixed the issue.
Anonymous
This is the detailed log file from the hung dfu-util programming of AM243x - above was same failure without
-vvv.The failure looks to be hanging after the first block of data is transferred and before we enumerate the device again:
Failing system
working example - which does not hang:
I remember having seen, many years ago, an issue with a program running via Python's subprocess. I will try to recall or find back to it.
You said that you added a lock that assures only one invocation of dfu-util is running at a time, but that didn't help. It therefore seems to me that the problem is not running dfu-util in parallel, but something else.
I may have found the issue. In the script there are individual steps to programming the bootloader and application (the script being written by TI called
usb_dfu_uniflash.py, in that scrip it checks the status of the target device usingdfu-util -lbetween steps to check enumeration of the device to make sure it is ready for the next step. It looks like the-p <path>can change between steps and the script can't handle that. I am going to modify TI's script and see if I can make this more reliable.