From c93f5d906d695602bb99fbc3402a78d3837f7d3f Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Fri, 13 Nov 2026 16:33:29 +0100 Subject: [PATCH] xiao_serial_dfu.sh: take a board name from the local config, not only a serial Co-Authored-By: Claude Opus 5.5 --- tools/xiao_serial_dfu.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/xiao_serial_dfu.sh b/tools/xiao_serial_dfu.sh index 3d526646..325399c5 100755 --- a/tools/xiao_serial_dfu.sh +++ b/tools/xiao_serial_dfu.sh @@ -7,7 +7,8 @@ # # firmware.zip the DFU package (.pio/build//firmware.zip, or a release # asset *.zip) -# usb-serial the board's USB serial number (matched in /dev/serial/by-id) +# usb-serial the board's USB serial number (matched in /dev/serial/by-id), +# or its name/alias in the local config # board its name for serial_cli.py (local config, tools/mctools_config.py) # # NRF= directory holding tool-adafruit-nrfutil @@ -34,6 +35,8 @@ esac exit 2 } ZIP=$1 SN=$2 BOARD=$3 +# a board name/alias of the local config -> its USB serial; a serial passes through +SN="$(python3 "$(dirname "$0")/mctools_config.py" serial "$SN" 2>/dev/null || echo "$SN")" WHY="$(python3 "$(dirname "$0")/mctools_config.py" get "$SN" refuse 2>/dev/null || true)" [ -z "$WHY" ] || { echo "refused: $WHY" >&2