diff --git a/README.md b/README.md index 1d9efc916..da74a54c9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Arduino_Tools [![GitHub release](https://img.shields.io/github/release/stm32duino/Arduino_Tools.svg)](https://github.com/stm32duino/Arduino_Tools/releases/latest) -[![GitHub commits](https://img.shields.io/github/commits-since/stm32duino/Arduino_Tools/2.2.3.svg)](https://github.com/stm32duino/Arduino_Tools/compare/2.2.3...master) +[![GitHub commits](https://img.shields.io/github/commits-since/stm32duino/Arduino_Tools/2.2.4.svg)](https://github.com/stm32duino/Arduino_Tools/compare/2.2.4...master) Contains upload tools for STM32 based boards and some other usefull scripts. diff --git a/linux/massStorageCopy.sh b/linux/massStorageCopy.sh index 237befa8b..3528c2203 100755 --- a/linux/massStorageCopy.sh +++ b/linux/massStorageCopy.sh @@ -20,12 +20,11 @@ usage() { echo "## Note:" echo "## -I and -O are optionals and kept for backward compatibility." echo "############################################################" - exit 0 + exit "$1" } if [ $# -lt 2 ]; then - usage - exit 1 + usage 1 fi # Parsing options diff --git a/macosx/massStorageCopy.sh b/macosx/massStorageCopy.sh index 0f176d15b..3b58ebf9f 100755 --- a/macosx/massStorageCopy.sh +++ b/macosx/massStorageCopy.sh @@ -20,12 +20,11 @@ usage() { echo "## Note:" echo "## -I and -O are optionals and kept for backward compatibility." echo "############################################################" - exit 0 + exit "$1" } if [ $# -lt 2 ]; then - usage - exit 1 + usage 1 fi # Parsing options diff --git a/stm32CubeProg.sh b/stm32CubeProg.sh index 56ac9921b..5cba7d839 100644 --- a/stm32CubeProg.sh +++ b/stm32CubeProg.sh @@ -25,7 +25,7 @@ usage() { echo "Usage: $(basename "$0") [OPTIONS]... Mandatory options: - -i, --interface <'swd'/'dfu'/'serial'> interface identifier: 'swd', 'dfu' or 'serial' + -i, --interface <'swd'/'dfu'/'serial'/'jlink'> interface identifier: 'swd', 'dfu', 'serial' or 'jlink' -f, --file file path to be downloaded: bin or hex Optional options: -e, --erase erase all sectors before flashing @@ -224,6 +224,9 @@ case "${INTERFACE}" in fi ${STM32CP_CLI} --connect port="${PORT}" "${RTS}" "${DTR}" "${ERASE}" --quietMode --download "${FILEPATH}" "${ADDRESS}" --start "${ADDRESS}" ;; + jlink) + ${STM32CP_CLI} --connect port=JLINK ap=0 "${ERASE}" --quietMode --download "${FILEPATH}" "${ADDRESS}" --start "${ADDRESS}" + ;; *) echo "Protocol unknown!" >&2 usage 4