Skip to content

NCS 3.5 sysbuild flashing, nRF91 UICR handling, tool updates - #28

Merged
jaredwolff merged 8 commits into
mainfrom
ncs-3.5-flash
Oct 15, 2026
Merged

jaredwolff merged 8 commits into
mainfrom
ncs-3.5-flash

Conversation

@jaredwolff

Copy link
Copy Markdown
Contributor

Summary

  • NCS 3.5 sysbuild flashing with probe-rs. Without Partition Manager there is no merged.hex, so images now come from domains.yaml flash_order and each image's runners.yaml. Non-app images (b0, MCUboot, provisioning, UICR) are merged into zephyr-tools/bootloaders.hex and flashed with --preverify, then the app. Partition Manager builds still flash merged.hex, chosen from the build's .config.
  • nRF91 UICR. probe-rs can't rewrite non-blank UICR. Before flashing, the device's UICR is read and compared with the build. If it already matches, UICR is stripped from the download. If it differs, a short modal asks to erase the chip, then recovery erases it.
  • Recovery 0.2.3. Recovery now runs with --no-reset, and the erase uses --force (CTRL-AP ERASEALL), so the debug port stays open for probe-rs after the erase. Errors name the step and recovery's last output.
  • Ctrl-C'd tasks are reported as failures. VS Code reports exit 0 for signal-killed tasks. Tasks now run under a /bin/sh SIGINT trap on POSIX.
  • Manifest v22. probe-rs 0.32.0, ninja 1.13.2, CMake 3.31.12, recovery 0.2.3. Every hash was checked against an upstream hash file or GitHub release digest.

Testing

  • 71 unit tests pass (flash-hex, intel-hex, uicr, flash-command).
  • Linux, Feather nRF9151 with ncs-serial-modem (NCS 3.5.0-preview3): flashes passed on the erase path (pristine build, new b0 key), the no-erase/preverify path, and from a power-cycled locked board.
  • Not yet tested on Windows or macOS. Do that before release.

Known issues

  • Two failures were each seen once on Linux and never reproduced. One was recovery Error: Timeout, which came from its final reset; that reset is now skipped. The other was probe-rs Core 0 is locked after an erase; --force is meant to address it, but the cause is unconfirmed.
  • The recovery erase step should be replaced with probe-rs download --chip-erase once a probe-rs release includes #4226.
  • probe-rs re-erases sectors that the recovery erase already cleared, so app flashes take about 20 s.
  • The macOS arm64 manifest has no ninja entry.

NCS 3.5 removed Partition Manager, so builds no longer produce
merged.hex. probe-rs flashing now resolves images from the build:

- Partition Manager builds (NCS <= 3.4), detected from the build's
  current zephyr/.config: flash merged.hex from the build root (sysbuild)
  or zephyr/ (child images), with no fallback to the other location.
- Sysbuild without Partition Manager: read domains.yaml flash_order and
  each image's runners.yaml hex_file. Non-application images (b0,
  MCUboot, provisioning, UICR) are merged into zephyr-tools/bootloaders.hex
  and flashed with --preverify, so unchanged bootloaders are skipped;
  the application is flashed separately. Does not depend on
  SB_CONFIG_MERGED_HEX_FILES. Images sharing a flash page are rejected.

nRF91 UICR can only be cleared by a full chip erase, and probe-rs fails
to program an already-written UICR word. Before flashing, the device's
UICR is read and compared: when every word the build writes is already
present, UICR is stripped from the download; otherwise the user confirms
a full erase via the recovery tool (until a probe-rs release includes
the nRF91 --chip-erase fix, #4226). Recovery now runs only for nRF91
chips, targets the selected probe, and waits longer for the probe.

Argument-array tasks (build, probe-rs, recovery, monitor, newtmgr,
west init) now use ProcessExecution instead of ShellExecution. VS Code
only quoted arguments containing whitespace, so e.g.
-DEXTRA_CONF_FILE=a.conf;b.conf was split by the shell.

Task completion waits subscribe before starting the task. The sidebar
lists merged hex files and finds the app ELF via domains.yaml. Tests
open a temporary workspace so VS Code tasks can run.
VS Code reports exit code 0 for a task process killed by a signal, so
Ctrl-C during a probe-rs download still reset the device and reported a
successful flash; a cancelled west flash still opened the monitor in
Flash and Monitor, and a cancelled build or west update continued its
TaskManager chain.

On POSIX every task now runs under /bin/sh, which traps SIGINT and exits
130 once the command has died:
- createProcessExecution passes the command and arguments as positional
  parameters ("$0" "$@"), so nothing is shell-parsed. Used by build,
  probe-rs download/reset, recovery, monitor, newtmgr load, west init,
  west update and the Python requirements install.
- createShellCommandExecution runs a command line for west flash, whose
  runnerParams is a raw shell fragment.
On Windows a Ctrl-C'd process already exits non-zero; tasks run directly
(or via the default task shell for command lines).

getRequirementsInstallCommand now returns argv instead of a hand-quoted
command string.
VS Code 1.110+ renamed the macOS executable from Contents/MacOS/Electron
to the product name, so test-electron 2.5.2 failed to launch it (spawn
ENOENT) on the macos-14 runner.
@jaredwolff
jaredwolff merged commit 02f5dc0 into main Oct 15, 2026
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