# nsx view

Open the SEGGER SWO viewer for a generated NSX app

## Usage

```text
nsx view [-h] [--app-dir APP_DIR] [--board BOARD]
                [--build-dir BUILD_DIR] [--toolchain TOOLCHAIN]
                [--sdk-root SDK_ROOT] [--probe-serial PROBE_SERIAL] [--frozen]
                [--reset-on-open | --no-reset-on-open]
                [--reset-delay-ms RESET_DELAY_MS] [--duration SECONDS]
                [--capture FILE] [--timeout SECONDS]
                [app]
```

## Arguments

| Option | Value | Default | Description |
| --- | --- | --- | --- |
| app | value | optional | App name or directory (overrides --app-dir; resolved under ./ and ./examples) |

## Options

| Option | Value | Default | Description |
| --- | --- | --- | --- |
| --app-dir APP_DIR | value | . | App directory containing nsx.yml |
| --board BOARD | value | optional | Override board from nsx.yml |
| --build-dir BUILD_DIR | value | optional | Build directory override |
| --toolchain TOOLCHAIN | value | optional | Toolchain override (gcc, armclang, atfe) |
| --sdk-root SDK_ROOT | value | optional | Optional out-of-tree AmbiqSuite root passed as NSX_AMBIQSUITE_ROOT_OVERRIDE |
| --probe-serial PROBE_SERIAL | value | optional | Optional SEGGER J-Link USB serial number to use |
| --frozen | flag | optional | When a (re)configure is needed, error on any drift between nsx.yml, nsx.lock, and modules/ instead of correcting it; modules missing from modules/ are fetched at their locked revision and verified. Note: passing --probe-serial always forces a reconfigure; --frozen only changes how the accompanying module sync behaves, not whether it runs. |
| --reset-on-open | flag | optional | Force a target reset after opening the SWO viewer. Cannot be combined with --no-reset-on-open. |
| --no-reset-on-open | flag | optional | Open the SWO viewer without issuing the app reset target after attach. Cannot be combined with --reset-on-open. |
| --reset-delay-ms RESET_DELAY_MS | value | 400 | Milliseconds to wait after opening the SWO viewer before issuing reset |
| --duration SECONDS | value | optional | Stop the viewer after SECONDS instead of running until interrupted |
| --capture FILE | value | optional | Line-stream the SWO output to FILE in addition to stdout |
| --timeout SECONDS | value | optional | Wall-clock budget per subprocess (seconds). Kills the whole process group on timeout. |

## Notes

By default `nsx view` chooses the board-appropriate reset policy. Most boards start the
viewer first and then run the app's normal SEGGER reset target once. Apollo4 secure boards
attach without resetting, because SEGGER's Apollo4 reset flow halts in the secure boot
handoff and can make the SWO viewer exit.

```bash
cd <app-dir>
nsx view
```

The viewer requires SEGGER SWO tooling in `PATH` and depends on the target being configured
for SWO output. Apollo4 secure boards are validated with `nsx flash` followed by an
attach-only `nsx view`. Apollo510 keeps the normal viewer-first `Reset` flow and does not
require a stronger reset mode.

`--app-dir` names the app directory containing `nsx.yml`; when it is omitted NSX searches
upward from the current directory. The positional `app` argument overrides `--app-dir` and
is resolved under the current directory and under `examples/`.

The out-of-tree SDK escape hatch is described under [SDK provider selection](/neuralspotx/guides/modules/sdk-providers/) in the guides.

`-v/--verbose`, `-q/--quiet` are parsed by `nsx` itself, so they go before the command name, as `nsx -v view`.
