Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw/scripts: Add JLINK_SN to nrfutil and nrfjprog #3357

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading