Skip to content
neuralSPOT-X
Getting started
HELIA HUB

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.

nsx probes enumerates connected J-Link probes and prints their USB serial numbers. This capture had five probes connected:

Probe discovery · captured output
$ nsx probes SERIAL PRODUCT NICKNAME 1160002954 J-Link-OB-Apollo4-CortexM - 1160003058 J-Link-OB-Apollo4-CortexM - 1160000172 J-Link-OB-Apollo4-CortexM - 1160001491 J-Link-OB-Apollo4-CortexM - 1160002255 J-Link-OB-Apollo4-CortexM -

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.

Flash your existing app, or reproduce this capture by creating a separate SWO app:

Terminal window
nsx create-app hello_swo --board apollo4p_blue_kxr_evb --template default
nsx build --app-dir hello_swo

The 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.

Flash · captured excerpts
$ nsx flash --app-dir hello_swo --probe-serial 1160001491 --frozen --timeout 120 SEGGER J-Link Commander V9.50 (Compiled Jun 10 2026 12:27:02) S/N: 1160001491 J-Link: Flash download: Program & Verify speed: 124 KB/s O.K. J-Link>Reset Device specific reset executed. J-Link>Go Script processing completed.

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:

SWO viewer · captured excerpts
$ nsx view --app-dir hello_swo --probe-serial 1160001491 --frozen --duration 8 --capture swo.txt --timeout 60 Starting SWO viewer for hello_swo on apollo4p_blue_kxr_evb Using attach-only SWO view for this secure-reset SoC; flash first or pass --reset-on-open to force a reset. Target CPU (AMA4B2KP-KXR) is running @ 96000 kHz. Receiving SWO data @ 1000 kHz. Showing data from stimulus port(s): 0 nsx hello from generated app nsx hello from generated app nsx hello from generated app

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.

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-open forces the reset.
  • --no-reset-on-open suppresses it.
  • --reset-delay-ms changes how long NSX waits after the viewer attaches before resetting.
  • --duration SECONDS stops the viewer on a timer instead of running until interrupted.
  • --capture FILE line-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.

From a configured app, reset uses the selected board’s J-Link device and speed:

Reset · captured command
$ nsx reset --app-dir hello_swo --probe-serial 1160001491 --verify-reconnect --timeout 60

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:

Terminal window
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.

  • Nothing listed by nsx probes: check the USB cable and that the board is powered, then re-run nsx doctor to 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-open only when your board supports that reset sequence.
  • More than one board on the desk: pass --probe-serial explicitly rather than letting NSX pick.

Next steps points at the guides, the module catalog and the reference.