Other Parts Discussed in Thread: UNIFLASH
Tool/software:
We have been attempting to use usb_dfu_uniflash.py to write a HS-SE conversion key writer to AM243x MCU with inconsistent results.
If we write the same key writer to the MCU via uart_uniflash.py, it works consistently.
We have tested this on three setups and four different board. In the best case this fails 6 out of 10 times. It fails more often on other boards and setups, realizing that 10-30 attempts isn't a large statistical sample.
When we make the attempt it is part of a provisioning script that we have written for our product that first erases the MCU (if not already found erased). The erase status is determined by using dfu-util -l and looking to see that USB path is returned for our device:
09:49:14 592 [INFO] Results of script: 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=15, cfg=1, intf=0, path="3-1.2.2.4", alt=1, name="SocId", serial="01.00.00.00" Found DFU: [0451:6165] ver=0200, devnum=15, cfg=1, intf=0, path="3-1.2.2.4", alt=0, name="bootloader", serial="01.00.00.00"
The script then writes to the MCU using usb_dfu_uniflash.py, this script does not fail. Example of output from logs below.
09:49:14 594 [INFO] Executing script: /Users/markwar/workspace/calamari/calamari/am243x/usb_dfu_uniflash.py --cfg /Users/markwar/workspace/calamari/tmp_conv_3-1.2.2.4_cu.usbserial-312300.cfg -p 3-1.2.2.4 and expecting "All\ commands\ from\ config\ file\ are\ executed" (RegEx) 09:49:14 594 [INFO] Script start ---------------------------------------- 09:49:16 183 [INFO] Results of script: 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 [ ] 0% 0 bytes Download [= ] 4% 14848 bytes Download [== ] 8% 29184 bytes Download [=== ] 12% 43520 bytes Download [==== ] 16% 57856 bytes Download [===== ] 20% 72192 bytes Download [====== ] 24% 86528 bytes Download [======= ] 28% 100864 bytes Download [======== ] 32% 115200 bytes Download [========= ] 36% 129536 bytes Download [========== ] 40% 143872 bytes Download [=========== ] 44% 158208 bytes Download [============ ] 48% 172544 bytes Download [============= ] 52% 186880 bytes Download [============== ] 56% 201216 bytes Download [=============== ] 60% 215552 bytes Download [=============== ] 63% 228864 bytes Download [================ ] 64% 229888 bytes Download [================= ] 68% 244224 bytes Download [================== ] 72% 258560 bytes Download [=================== ] 76% 272896 bytes Download [==================== ] 80% 287232 bytes Download [===================== ] 84% 301568 bytes Download [====================== ] 88% 315904 bytes Download [======================= ] 92% 330240 bytes Download [======================== ] 96% 345088 bytes Download [=========================] 100% 358431 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! Parsing config file ... Parsing config file ... SUCCESS. Found 1 command(s) !!! Executing command 1 of 1 ... Found flash writer ... sending /Users/markwar/workspace/calamari/tests/resources/sbl_tiboot3_otp_data_idx_0_ff.bin >>> sudo /opt/homebrew/bin/dfu-util -l -p 3-1.2.2.4 ---------------------------------------------------------------------------- Executing DFU command with alt_setting=0 interface=0 transfer_size=512 ---------------------------------------------------------------------------- >>> sudo /opt/homebrew/bin/dfu-util -a 0 -i 0 -t 512 -D /Users/markwar/workspace/calamari/tests/resources/sbl_tiboot3_otp_data_idx_0_ff.bin -p 3-1.2.2.4 Sent flashwriter /Users/markwar/workspace/calamari/tests/resources/sbl_tiboot3_otp_data_idx_0_ff.bin of size 358431 bytes in 1.49s. Bandwidth = 234.92kbps All commands from config file are executed !!! 09:49:16 183 [INFO] Script end (/Users/markwar/workspace/calam) ----------------------------------------
After the above using usb_dfu_uniflash.py script is run we look at the UART output of the MCU. Most commonly we see the MCU fail to finish booting. It doesn't hang at the same place in all cases, but the example below is the most common place we see it hang.
Starting Keywriting
Set GPIO0_74 high to enable VPP 1.8v
Please ent
In less common cases it looks the MCU boots and we get the sbl_keywriter # prompt, but the MCU hangs in response to the START_PROGRAM_KEY command. Again not always in the same place, so here are a few examples of the output we see from our logs when we make the attempt.
sbl_keywriter # START_PROGRAM_KEY
Start programming OTP keys:
keys Certificate found: 0x70052600
sbl_keywriter # START_PRO
sbl_keywriter # START_PROGRAM_KEY
Start programming OTP keys:
keys Certificate found: 0x'
When this works we see the following output.
sbl_keywriter # START_PROGRAM_KEY
Start programming OTP keys:
keys Certificate found: 0x70052600
Keywriter Debug Response:0x0
Success Programming Keys
Set GPIO0_74 low to disable
Again to be clear about the question: Has TI tested this HS-SE conversion key writer when loaded via both UART and USB?
What can I do to make this process reliable via USB?