Report dfu boot problem to LPC Link2 with lpscrypt under Linux

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Report dfu boot problem to LPC Link2 with lpscrypt under Linux

62 次查看
sprhawk
Contributor I

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:

sprhawk_1-1722609817329.png

cause here DEVICE_VID_PID is 0x1f9c:0x000c

sprhawk_0-1722609793109.png

Which prevents from detecting dfu mode

0 项奖励
回复
1 回复

4 次查看
HangZhang
NXP Employee
NXP Employee

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

0 项奖励
回复