Flash, reset and view
This is the first page in the section that needs hardware: a board with a SEGGER J-Link,
which on many Ambiq EVBs is onboard rather than a separate probe. It also needs the
J-Link Software and Documentation Pack, so if
nsx doctor still reports the SEGGER checks as
failures, fix that first.
The terminal excerpts below were captured on 2026-11-07 using an Apollo4 Blue Plus
EVB (apollo4p_blue_kxr_evb), probe 1160001491, and the default hello-world
template. The Linux host ran NSX 0.9.4 from PR #320’s documentation branch
(3c050c9, unchanged CLI from release 86d92dd), SDK 5.2.29, Arm GNU Toolchain
15.2.Rel1, and SEGGER J-Link 9.50.
Flash and viewer output is shortened; omitted lines include build paths, progress
updates, banners and repeated heartbeats. Commands show nsx in place of the
checkout’s uv run nsx, with local paths shortened to hello_swo and swo.txt.
Use your own probe serial and app directory. These are debugger-connected smoke
checks, not cold-boot, power or comprehensive board qualification.
1. Find the probe
Section titled “1. Find the probe”nsx probes enumerates connected J-Link probes and prints their USB serial numbers. This capture had five probes connected:
With a board attached it lists one line per probe. --json gives the same list in
machine-readable form. If exactly one probe is connected you never need to name it; with
more than one, pass --probe-serial <serial> to every command that touches hardware. The
serial is printed here and on the probe label.
The J-Link-OB-Apollo4-CortexM product name identifies the onboard probe, not the
target MCU; different EVB families can report the same name. Select the serial
that belongs to your board.
See nsx probes.
2. Flash
Section titled “2. Flash”Flash your existing app, or reproduce this capture by creating a separate SWO app:
nsx create-app hello_swo --board apollo4p_blue_kxr_evb --template defaultnsx build --app-dir hello_swoThe first build creates nsx.lock and prepares the firmware. The captured flash
command uses --frozen, which requires that lock; it cannot follow create-app
alone.
nsx flash builds the app if the image is out of date, then drives JLinkExe over SWD
using the command file NSX generated into build/<board>/jlink/. Expect the Ninja build
lines you already saw from nsx build, if anything needed rebuilding, followed by
J-Link’s own connect, program and verify output, and then a reset that starts the
firmware.
nsx flash takes the same --board, --toolchain, --target, --jobs, --update and
--frozen options as nsx build, plus --probe-serial.
See nsx flash.
After flashing the blinky app, the first BSP LED should alternate on and off every half second. Its label varies by board. Check the board’s LED jumpers and routing if flashing succeeds but the LED stays dark. Blinky emits no SWO output, so a viewer is not needed for this first check.
3. Optional: try SWO with the default template
Section titled “3. Optional: try SWO with the default template”The default template used above prints a heartbeat through SWO. If you started
with blinky, create and flash the separate hello_swo app shown above first.
nsx view opens JLinkSWOViewerCL against the board’s SEGGER device and streams ITM
port 0. This eight-second capture received eight heartbeat lines; three are shown:
Without --duration, press Ctrl-C to stop. This capture used the board’s default
attach-only policy and did not reset the running application when opening the viewer.
The reset policy
Section titled “The reset policy”Whether the viewer resets the target after it attaches depends on the SoC. NSX resets by
default, except on the apollo3p, apollo4l, apollo4p and apollo510b SoCs, where a
SEGGER reset can halt in the secure boot handoff and drop the viewer. On those boards NSX
attaches without resetting and prints a line telling you so, which is why the working
order there is nsx flash and then nsx view: the flash already started the app.
Three options override it:
--reset-on-openforces the reset.--no-reset-on-opensuppresses it.--reset-delay-mschanges how long NSX waits after the viewer attaches before resetting.
Recording instead of watching
Section titled “Recording instead of watching”--duration SECONDSstops the viewer on a timer instead of running until interrupted.--capture FILEline-streams the output to a file as well as to your terminal.
Together they make a viewer run scriptable, which is what CI and benchmark harnesses use.
Use --duration rather than wrapping the command in timeout. On Linux and macOS NSX also
stops the viewer if it is sent SIGTERM, but --duration ends the capture cleanly.
See nsx view.
4. Reset on its own
Section titled “4. Reset on its own”From a configured app, reset uses the selected board’s J-Link device and speed:
This command returned exit status 0 with no console output. A subsequent
five-second nsx view capture received five heartbeat lines, confirming that the
application resumed after reset. --verify-reconnect alone confirms the debug
connection, not application behavior.
Use --build-dir when the app was configured into a custom build directory.
Reset reads the existing CMake configuration; it does not build or fetch modules.
If configuration is missing or was generated by an older NSX version, run
nsx configure with the same app, board, and build-directory selection first.
Reconfigure after changing board settings.
For standalone use without an app, pass an explicit SEGGER device:
nsx reset --device AP510NFA-CBR--device bypasses app lookup, including any app or board selectors. Standalone
resets default to 4000 kHz. App resets use the configured speed and probe serial;
--speed-khz and --probe-serial override those values for this reset only.
--kind picks the reset primitive, debug or swpoi. --interface and --speed-khz
set the debug interface and its speed, and --verify-reconnect reconnects afterwards and
fails if the target did not come back.
See nsx reset.
When it does not work
Section titled “When it does not work”- Nothing listed by
nsx probes: check the USB cable and that the board is powered, then re-runnsx doctorto confirm the SEGGER runtime starts. - Flash succeeds but the viewer shows nothing: on a secure-reset SoC the app may not have
been started. Flash again, then attach without resetting. Use
--reset-on-openonly when your board supports that reset sequence. - More than one board on the desk: pass
--probe-serialexplicitly rather than letting NSX pick.
Next steps points at the guides, the module catalog and the reference.