diff --git a/hw/scripts/nrfjprog.sh b/hw/scripts/nrfjprog.sh index f1ae4e14e5..e7f5bab9b4 100644 --- a/hw/scripts/nrfjprog.sh +++ b/hw/scripts/nrfjprog.sh @@ -44,12 +44,12 @@ nrfjprog_load () { echo "Downloading" $FILE_NAME "to" $FLASH_OFFSET - nrfjprog ${NRFJPROG_ARG} --program ${BIN_BASENAME}.hex --sectorerase --verify + nrfjprog ${NRFJPROG_ARG} --program ${BIN_BASENAME}.hex --sectorerase --verify ${JLINK_SN:+--snr $JLINK_SN} if [ $? -ne 0 ]; then exit 1 fi - nrfjprog --reset + nrfjprog --reset ${JLINK_SN:+--snr $JLINK_SN} return 0 } diff --git a/hw/scripts/nrfutil.sh b/hw/scripts/nrfutil.sh index ce86d7c619..c9ba40e511 100755 --- a/hw/scripts/nrfutil.sh +++ b/hw/scripts/nrfutil.sh @@ -77,12 +77,12 @@ nrfutil_load () { if [ -z ${ZIP_FILE} ] ; then echo "Downloading" ${HEX_FILE} - nrfutil device program --firmware ${HEX_FILE} ${NRFUTIL_ARG} ${NRFUTIL_TRAITS} --options chip_erase_mode=ERASE_RANGES_TOUCHED_BY_FIRMWARE + nrfutil device program --firmware ${HEX_FILE} ${JLINK_SN:+--serial-number $JLINK_SN} ${NRFUTIL_ARG} ${NRFUTIL_TRAITS} --options chip_erase_mode=ERASE_RANGES_TOUCHED_BY_FIRMWARE if [ $? -ne 0 ]; then ret=1 else - nrfutil device reset + nrfutil device reset ${JLINK_SN:+--serial-number $JLINK_SN} fi fi diff --git a/hw/scripts/pyocd.sh b/hw/scripts/pyocd.sh index 07355bd3a3..59a76dfe2c 100755 --- a/hw/scripts/pyocd.sh +++ b/hw/scripts/pyocd.sh @@ -53,7 +53,7 @@ pyocd_load () { echo "Downloading" $FILE_NAME "to" $FLASH_OFFSET - pyocd flash -e sector -M $CONNECTION_MODE -t $TARGET $FILE_NAME@$FLASH_OFFSET --format bin + pyocd flash -e sector -M $CONNECTION_MODE -t $TARGET $FILE_NAME@$FLASH_OFFSET --format bin ${JLINK_SN:+-u $JLINK_SN} if [ $? -ne 0 ]; then exit 1 fi