Skip to content

Commit

Permalink
hw/scripts: Add JLINK_SN to nrfutil and nrfjprog
Browse files Browse the repository at this point in the history
  • Loading branch information
mkasenberg committed Dec 10, 2024
1 parent 5f8038e commit f97c9d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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

0 comments on commit f97c9d2

Please sign in to comment.