1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #15807 from haukepetersen/opt_jlink_versioncheckstuff

tools/jlink.sh: fix version check and allow to skip it
This commit is contained in:
Hauke Petersen 2021-01-25 14:03:06 +01:00 committed by GitHub
commit ce0d589384
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,21 +156,23 @@ test_term() {
}
test_version() {
JLINK_MINIMUM_VERSION="6.74"
# Adding '-nogui 1' will simply return 'Unknown command line option -nogui'
# on older versions, JLINK_VERSION will still be parsed correctly.
JLINK_VERSION=$(echo q | "${JLINK}" -nogui 1 2> /dev/null | grep "^DLL version*" | grep -oE "[0-9]+\.[0-9]+")
if [ -z "${JLINK_SKIP_VERSION}" ]; then
JLINK_MINIMUM_VERSION="6.74"
# Adding '-nogui 1' will simply return 'Unknown command line option -nogui'
# on older versions, JLINK_VERSION will still be parsed correctly.
JLINK_VERSION=$(echo q | "${JLINK}" "${JLINK_SERIAL}" -nogui 1 2> /dev/null | grep "^DLL version*" | grep -oE "[0-9]+\.[0-9]+")
if [ $? -ne 0 ]; then
echo "Error: J-Link appears not to be installed on your PATH"
exit 1
fi
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
"$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
if [ $? -ne 0 ]; then
echo "Error: J-Link V$JLINK_MINIMUM_VERSION is required, but V${JLINK_VERSION} is installed"
exit 1
fi
fi
}
@ -180,8 +182,8 @@ test_version() {
do_flash() {
BINFILE=$1
test_config
test_version
test_serial
test_version
test_binfile
# clear any existing contents in burn file
/bin/echo -n "" > ${BINDIR}/burn.seg
@ -210,8 +212,8 @@ do_flash() {
do_debug() {
ELFFILE=$1
test_config
test_version
test_serial
test_version
test_elffile
test_ports
test_tui
@ -235,9 +237,9 @@ do_debug() {
do_debugserver() {
test_config
test_serial
test_version
test_ports
test_serial
# start the J-Link GDB server
sh -c "${JLINK_SERVER} ${JLINK_SERIAL_SERVER} \
-nogui \
@ -250,8 +252,8 @@ do_debugserver() {
do_reset() {
test_config
test_version
test_serial
test_version
# reset the board
sh -c "${JLINK} ${JLINK_SERIAL} \
-nogui 1 \
@ -265,8 +267,8 @@ do_reset() {
do_term() {
test_config
test_version
test_serial
test_version
test_term
# temporary file that save the J-Link Commander pid