Skip to content

Commit

Permalink
hw/scripts: Add JLINK_SN to nrfutil, nrfjprog and pyocd
Browse files Browse the repository at this point in the history
  • Loading branch information
mkasenberg authored and sjanc committed Dec 17, 2024
1 parent 5f8038e commit 83e5933
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hw/scripts/nrfjprog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions hw/scripts/nrfutil.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion hw/scripts/pyocd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 83e5933

Please sign in to comment.