From 7befca8a91dfbe52da36d97e7c2fdd1877086a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikolai=20G=C3=BCtschow?= Date: Tue, 29 Apr 2025 10:59:29 +0200 Subject: [PATCH] tools/uf2/nrf52_softdevice_check: abort when several bootloaders present The current tooling cannot distinguish which one is the correct one to flash. --- dist/tools/uf2/nrf52_softdevice_check.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dist/tools/uf2/nrf52_softdevice_check.sh b/dist/tools/uf2/nrf52_softdevice_check.sh index 9a30aca366..88a752a62c 100755 --- a/dist/tools/uf2/nrf52_softdevice_check.sh +++ b/dist/tools/uf2/nrf52_softdevice_check.sh @@ -24,10 +24,17 @@ if [ -z "${MOUNTPOINT}" ]; then exit 1 fi +if [ ! "$(echo "${MOUNTPOINT}" | wc -l)" -eq 1 ]; then + echo "More than one device with UF2 bootloader found!" + echo "RIOT cannot distinguish the correct device."\ + "Please connect no more than one device at a time." + exit 1 +fi + INFO_FILE="${MOUNTPOINT}/INFO_UF2.TXT" if [ ! -f "${INFO_FILE}" ]; then - echo "No INFO_FILE.TXT found in UF2 Mass Storage Device!" + echo "No INFO_UF2.TXT found in UF2 Mass Storage Device!" exit 1 fi