There is a problem in dfu_boot script in lpcscrypt under linux. the version is installed via LinkServer_1.6.133.x86_64.deb.bin
My installed dfu-util is 0.11
whose output is following
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: [1fc9:000c] ver=0100, devnum=115, cfg=1, intf=0, path="3-1", alt=0, name="DFU", serial="ABCD"
but vp_hex generated is not corrected:
cause here DEVICE_VID_PID is 0x1f9c:0x000c
Which prevents from detecting dfu mode
解決済! 解決策の投稿を見る。
Hi @sprhawk
It looks like the script is not correctly parsing the dfu-util version and as a result, the vp_hex variable is not being set properly. Your output indicates dfu-util version 0.11, but the script is not handling this correctly.
Here’s a fix for the script to correctly handle dfu-util version 0.11:
1. Adjust the script to correctly parse the dfu-util version.
2. Set the vp_hex variable based on the version detected.
# Establish what kind of prefix VID:PIDs have when listed in -l
vp_hex=""
# Extract major and minor versions
dfu_major_ver=$(echo "$dfu_ver" | cut -d '.' -f 1)
dfu_minor_ver=$(echo "$dfu_ver" | cut -d '.' -f 2)
# Check if dfu_major_ver is 0 and dfu_minor_ver is 11
if [ "$dfu_major_ver" -eq 0 ] && [ "$dfu_minor_ver" -eq 11 ]; then
vp_hex="0x"
fi
# echo "DFU version $dfu_ver means we should use hex prefix '$vp_hex'"
DEVICE_VID_PID="${vp_hex}${DEVICE_VID}:${vp_hex}${DEVICE_PID}"
# DEVICE_VID_PID="\(0x\|\)$DEVICE_VID:\(0x\|\)$DEVICE_PID"
This script correctly checks for the major and minor version of dfu-util and sets the vp_hex variable accordingly. It should resolve the issue of incorrectly setting the DEVICE_VID_PID variable.
BR
Hang
Hi @sprhawk
It looks like the script is not correctly parsing the dfu-util version and as a result, the vp_hex variable is not being set properly. Your output indicates dfu-util version 0.11, but the script is not handling this correctly.
Here’s a fix for the script to correctly handle dfu-util version 0.11:
1. Adjust the script to correctly parse the dfu-util version.
2. Set the vp_hex variable based on the version detected.
# Establish what kind of prefix VID:PIDs have when listed in -l
vp_hex=""
# Extract major and minor versions
dfu_major_ver=$(echo "$dfu_ver" | cut -d '.' -f 1)
dfu_minor_ver=$(echo "$dfu_ver" | cut -d '.' -f 2)
# Check if dfu_major_ver is 0 and dfu_minor_ver is 11
if [ "$dfu_major_ver" -eq 0 ] && [ "$dfu_minor_ver" -eq 11 ]; then
vp_hex="0x"
fi
# echo "DFU version $dfu_ver means we should use hex prefix '$vp_hex'"
DEVICE_VID_PID="${vp_hex}${DEVICE_VID}:${vp_hex}${DEVICE_PID}"
# DEVICE_VID_PID="\(0x\|\)$DEVICE_VID:\(0x\|\)$DEVICE_PID"
This script correctly checks for the major and minor version of dfu-util and sets the vp_hex variable accordingly. It should resolve the issue of incorrectly setting the DEVICE_VID_PID variable.
BR
Hang