This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 83e5933c7 hw/scripts: Add JLINK_SN to nrfutil, nrfjprog and pyocd
83e5933c7 is described below
commit 83e5933c7fb5e02bb8f14bb39b6531ae767d0a52
Author: Magdalena Kasenberg <[email protected]>
AuthorDate: Tue Dec 10 10:17:20 2024 +0100
hw/scripts: Add JLINK_SN to nrfutil, nrfjprog and pyocd
---
hw/scripts/nrfjprog.sh | 4 ++--
hw/scripts/nrfutil.sh | 4 ++--
hw/scripts/pyocd.sh | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/scripts/nrfjprog.sh b/hw/scripts/nrfjprog.sh
index f1ae4e14e..e7f5bab9b 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 ce86d7c61..c9ba40e51 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 07355bd3a..59a76dfe2 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