主题中讨论的其他器件:UNIFLASH
工具与软件:
我们一直在尝试使用 usb_dfu_uniflash.py 将 HS-SE 转换密钥写入器写入 AM243x MCU、但结果不一致。
如果我们通过 uart_uniflash.py 将相同的密钥写入器写入 MCU、则会保持一致的工作状态。
我们在三种设置和四种不同的板上进行了测试。 在最好的情况下、它10次中有6次失败。 它在其他电路板和设置上更经常失败、意识到10-30次尝试不是一个大型统计样本。
尝试时、它是我们为产品编写的配置脚本的一部分、首先擦除 MCU (如果尚未找到已擦除的 MCU)。 擦除状态是通过使用 dfu-util -l 确定的、并查看返回的器件 USB 路径:
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 sourceforge.net/.../ 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"
然后、脚本使用 USB_DFU_uniflash.py 写入 MCU、此脚本不会失败。 以下日志的输出示例。
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 sourceforge.net/.../ 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) ----------------------------------------
在 使用 usb_dfu_uniflash.py 脚本运行上述操作后、我们 可以查看 MCU 的 UART 输出。 我们通常会看到 MCU 无法完成引导。 它并非在所有情况下都悬挂在同一个位置、但下面的示例是我们看到它悬挂的最常见位置。
Starting Keywriting Set GPIO0_74 high to enable VPP 1.8v Please ent
在不太常见的情况下、它看起来是 MCU 引导、我们得到了 sbl_keywriter #提示符、但 MCU 会因响应 start_program_key 命令而挂起。 这里是我们尝试时从日志中看到的输出的几个示例、并非总是位于同一个位置。
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'
当该操作正常时、我们会看到以下输出。
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
再次明确的问题:当通过 UART 和 USB 加载时、TI 是否测试了此 HS-SE 转换密钥写入器?
如何通过 USB 使此过程可靠?


