Skip to content

Flash the SDK's merged hex for sysbuild builds; ask for pin reset after nRF91 UICR write (0.7.1) - #29

Merged
jaredwolff merged 3 commits into
mainfrom
flash-merged-hex
Nov 8, 2026
Merged

jaredwolff merged 3 commits into
mainfrom
flash-merged-hex

Conversation

@jaredwolff

Copy link
Copy Markdown
Contributor

Summary

  • Flash merged_<board_target>.hex for sysbuild builds (NCS 3.5+). Previously the non-application images (on the nRF9151 Feather, only the UICR debug-access image) were merged into zephyr-tools/bootloaders.hex and flashed in a separate probe-rs session from the application. The chip reset between sessions with UICR written but no application to reopen the debug port, so the nRF91x1 locked it and the application download failed. Now the SDK's merged hex (from SB_CONFIG_MERGED_HEX_FILES) is flashed in one download per board target in domains.yaml flash_order. If it's missing, flashing stops with a message saying to set the option. The extension doesn't add any hidden -D to the build; the board or project enables it (nfed's feather_nrf9151 defaults it on).
  • Ask for a pin reset after an nRF91 UICR write. New UICR values, including APPROTECT, only take effect on a pin or power-on reset. After the first flash following a chip erase, the debug port locks as soon as the probe-rs session ends, so the post-flash probe-rs reset always failed with an erase_all permission error. The Feather's onboard probe has no reset line, so --connect-under-reset doesn't help. In that case the reset is skipped and the user is asked to press reset or power-cycle. Flashes where UICR already matches are unchanged.
  • Removes the bootloader split, its forced --preverify, and the hex merge/range helpers only it used.
  • Release 0.7.1 with changelog.

Behavior change

Sysbuild builds flashed with probe-rs need SB_CONFIG_MERGED_HEX_FILES=y. Partition Manager builds (NCS ≤ 3.4) and single-image builds are unaffected.

Testing

  • npm run check-types, npm run lint, npm test (70 passing).
  • On a Feather nRF9151 (ret_lxmf, NCS 3.5, CONFIG_NRF91_ANOMALY_36_WORKAROUND=y): after a recovery erase, a single probe-rs download --verify of the merged hex succeeds, UICR then reads 0x50FA50FA at 0xFF8000/0xFF802C, and the chip is locked until the reset button is pressed or the board is power-cycled. After that, probe-rs reset succeeds and the chip stays unlocked.
  • Not yet exercised end-to-end from the Extension Development Host after the reset-message change.

Sysbuild builds without Partition Manager were flashed as two probe-rs
downloads: the non-application images (here only the nRF9151 Feather's
UICR image) merged into zephyr-tools/bootloaders.hex, then the
application. The chip reset between the sessions with UICR written but
no application to reopen the debug port, so the nRF91x1 locked it and
the application download failed.

Flash merged_<board_target>.hex from SB_CONFIG_MERGED_HEX_FILES instead,
one download per board target in domains.yaml flash_order. The board or
project enables it; if the file is missing, flashing fails with a
message saying to set it. The UICR strip/erase step is unchanged.

Removes the bootloader split, its forced --preverify, and the hex merge
and range helpers only it used.
New UICR values, APPROTECT included, only take effect after a pin or
power-on reset. After a flash that writes UICR (the erase path), the
nRF91 locks its debug port as soon as the probe-rs session ends, so the
post-flash probe-rs reset always failed with an erase_all permission
error. The Feather's onboard probe has no reset line, so
--connect-under-reset doesn't help.

Skip the reset in that case and tell the user to press the board's
reset button or power-cycle it. Flashes where UICR already matches are
unchanged.
@jaredwolff
jaredwolff merged commit aa280ab into main Nov 8, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant