dist/jlink: check for minimum version
This commit is contained in:
parent
237a24d51b
commit
62530f42c8
22
dist/tools/jlink/jlink.sh
vendored
22
dist/tools/jlink/jlink.sh
vendored
@ -155,12 +155,30 @@ test_term() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_version() {
|
||||||
|
JLINK_MINIMUM_VERSION="6.74"
|
||||||
|
JLINK_VERSION=$(echo q | "$JLINK" 2> /dev/null | grep "^DLL version*" | grep -oP "\d+\.\d+")
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error: J-Link appears not to be installed on your PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$RIOTTOOLS"/has_minimal_version/has_minimal_version.sh "$JLINK_VERSION" "$JLINK_MINIMUM_VERSION" 2> /dev/null
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error: J-Link V$JLINK_MINIMUM_VERSION is required, but V${JLINK_VERSION} is installed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# now comes the actual actions
|
# now comes the actual actions
|
||||||
#
|
#
|
||||||
do_flash() {
|
do_flash() {
|
||||||
BINFILE=$1
|
BINFILE=$1
|
||||||
test_config
|
test_config
|
||||||
|
test_version
|
||||||
test_serial
|
test_serial
|
||||||
test_binfile
|
test_binfile
|
||||||
# clear any existing contents in burn file
|
# clear any existing contents in burn file
|
||||||
@ -190,6 +208,7 @@ do_flash() {
|
|||||||
do_debug() {
|
do_debug() {
|
||||||
ELFFILE=$1
|
ELFFILE=$1
|
||||||
test_config
|
test_config
|
||||||
|
test_version
|
||||||
test_serial
|
test_serial
|
||||||
test_elffile
|
test_elffile
|
||||||
test_ports
|
test_ports
|
||||||
@ -212,6 +231,7 @@ do_debug() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do_debugserver() {
|
do_debugserver() {
|
||||||
|
test_version
|
||||||
test_ports
|
test_ports
|
||||||
test_config
|
test_config
|
||||||
test_serial
|
test_serial
|
||||||
@ -227,6 +247,7 @@ do_debugserver() {
|
|||||||
|
|
||||||
do_reset() {
|
do_reset() {
|
||||||
test_config
|
test_config
|
||||||
|
test_version
|
||||||
test_serial
|
test_serial
|
||||||
# reset the board
|
# reset the board
|
||||||
sh -c "${JLINK} ${JLINK_SERIAL} \
|
sh -c "${JLINK} ${JLINK_SERIAL} \
|
||||||
@ -241,6 +262,7 @@ do_reset() {
|
|||||||
|
|
||||||
do_term() {
|
do_term() {
|
||||||
test_config
|
test_config
|
||||||
|
test_version
|
||||||
test_serial
|
test_serial
|
||||||
test_term
|
test_term
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user