Skip to content

Commit b2a224d

Browse files
committed
docs(wiki): refresh setup and lab coverage (2026.6.14.0-BED1)
1 parent bed1789 commit b2a224d

8 files changed

Lines changed: 189 additions & 24 deletions

File tree

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Parsec CouchLink lets a remote Parsec player use a real retro console as player
44

55
The Windows host reads the Parsec virtual Xbox controller, sends the button state over Wi-Fi, and a Raspberry Pi Pico 2 W or Pico W presents that input as a wired Xbox 360 controller to a USB-to-console adapter such as USB4MAPLE.
66

7-
**[Wiki](https://github.com/RealWhyKnot/ParsecCouchLink/wiki)** | **[Quick Start](https://github.com/RealWhyKnot/ParsecCouchLink/wiki/Quick-Start)** | **[Troubleshooting](https://github.com/RealWhyKnot/ParsecCouchLink/wiki/Troubleshooting)**
7+
**[Releases](https://github.com/RealWhyKnot/ParsecCouchLink/releases)** | **[Wiki](https://github.com/RealWhyKnot/ParsecCouchLink/wiki)** | **[Quick Start](https://github.com/RealWhyKnot/ParsecCouchLink/wiki/Quick-Start)** | **[Troubleshooting](https://github.com/RealWhyKnot/ParsecCouchLink/wiki/Troubleshooting)**
88

99
## What You Need
1010

@@ -61,6 +61,7 @@ Useful commands:
6161
.\couchlink.exe debug --to-wifi --port COM3
6262
.\couchlink.exe bootsel --port COM3
6363
.\couchlink.exe lab --scenario status
64+
.\couchlink.exe lab --scenario full --power pnp-remove --no-flash --json .\lab-report.json
6465
.\couchlink.exe test discover --ip 192.168.50.4
6566
.\couchlink.exe test usb --all
6667
.\couchlink.exe bundle
@@ -71,6 +72,12 @@ Pico into setup-mode USB before asking for new credentials. If the existing
7172
Wi-Fi is still correct after a firmware update, keep the current Wi-Fi and
7273
start streaming.
7374

75+
`couchlink lab` is for development benches with the Pico plugged into the
76+
Windows host. `--power pnp-remove` asks Windows to remove and rescan the
77+
CouchLink Pico devices, including the run-mode XInput controller, which is
78+
useful for checking reconnect handling. It is not a physical cable pull or a
79+
USB power cut; use an external power backend for that.
80+
7481
## Reporting bugs
7582

7683
If something went wrong, the fastest path is:
@@ -98,7 +105,9 @@ page for the full version.
98105
- `build.ps1` - local build and release zip staging.
99106
- `wiki/` - source-controlled GitHub Wiki pages.
100107

101-
The project is pre-release. Runtime protocol v1 and setup protocol v1 are documented in the [Protocol](wiki/Protocol.md) wiki page.
108+
Runtime protocol v1 and setup protocol v1 are documented in the
109+
[Protocol](wiki/Protocol.md) wiki page. Hardware bench coverage is documented
110+
in [Hardware Lab](wiki/Hardware-Lab.md).
102111

103112
## License
104113

wiki/Build.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,32 @@ pico-bridge\dist\couchlink-picow.uf2
7474

7575
The pico-sdk clone is shared across per-board build directories (`build-pico2w/`, `build-picow/`) via a sibling `build-_pico_sdk/` folder, so a dual-board build only fetches the SDK once.
7676

77+
## Tests
78+
79+
Run the Rust bridge tests:
80+
81+
```powershell
82+
cargo test --manifest-path bridge\Cargo.toml
83+
```
84+
85+
Run the C host tests for firmware setup and boot-mode policy code:
86+
87+
```powershell
88+
cmake -S pico-bridge -B build-host-tests -DPICO_BRIDGE_HOST_TESTS=ON
89+
cmake --build build-host-tests --config Debug
90+
ctest --test-dir build-host-tests -C Debug --output-on-failure
91+
```
92+
93+
Run the formatting and lint wrapper used locally before commits:
94+
95+
```powershell
96+
powershell -NoProfile -ExecutionPolicy Bypass -File .\tools\lint.ps1
97+
```
98+
99+
For plugged-in Pico benches, see [[Hardware Lab]]. The lab harness can produce
100+
a JSON report and can exercise setup-mode reconnects, BOOTSEL flash cycles,
101+
run-mode XInput enumeration, and controller signal checks.
102+
77103
## GitHub Workflows
78104

79105
- `ci.yml` checks the Rust bridge and builds the Pico firmware.

wiki/Changelog.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
# Changelog
22

3-
## Unreleased
3+
## Current Release
44

5-
- The no-argument guided menu now opens on a **Basic** tab with one card per saved or detected Pico. Each Pico card exposes only commands for that Pico, such as streaming, Wi-Fi setup, recovery, firmware flashing, USB diagnostics, saving, or removal. One-off diagnostics and fixes are grouped under the **Advanced** tab.
6-
- Direct `couchlink run` can auto-recover setup-mode USB Picos that already have saved Wi-Fi by rebooting them back to Wi-Fi/controller mode and retrying discovery. The **Basic** tab exposes targeted recovery under each USB Pico, the **Advanced** tab exposes **Auto recover for streaming**, and `couchlink recover` runs the same check directly.
7-
- Guided menus now include short inline hints for each choice. The **Advanced** tab adds firmware update, Wi-Fi setup, a quick status dashboard, Wi-Fi finder/manual-IP probe, Windows controller check, Pico recovery, USB adapter diagnostics, logs, support bundles, and a command reference grouped by setup, streaming, recovery, and diagnostics.
8-
- `couchlink debug` adds a guided Pico recovery menu and direct mode-switch commands for Wi-Fi/controller mode, USB debug mode, and BOOTSEL firmware mode. `couchlink bootsel` is the fast direct command for moving a setup-mode USB Pico into BOOTSEL.
9-
- `couchlink test usb` asks run-mode firmware over Wi-Fi for USB/XInput status, including mount/configuration state, descriptor counters, accepted IN reports, and host OUT traffic. The guided **Basic** and **Advanced** tabs expose the same check for console-adapter troubleshooting.
10-
- Release packaging describes only the current CouchLink setup, streaming, diagnostic, flashing, and Wi-Fi configuration tools. Protocol docs list the active setup and runtime commands.
11-
- Firmware writes one heartbeat line every 5 seconds while running, covering USB mount/suspend state, Wi-Fi state with IP and RSSI, peer presence, and tx/rx packet counters. A quiet system used to leave the diag ring with no recent entries; the heartbeat guarantees there is always state to reason about in `pico-diag.txt`.
12-
- Firmware fault context expanded. On HardFault / BusFault / UsageFault / MemManage the breadcrumb now captures the full hardware-stacked basic exception frame (R0-R3, R12, LR, PC, xPSR) plus SP and -- on Cortex-M33 / Pico 2 W -- the CFSR / HFSR / MMFAR / BFAR. The next boot's log names the cause directly (divide-by-zero, unaligned-access, precise-bus-error, etc.) rather than just an address.
13-
- Bridge writes a `state-journal.log` next to the rotating log: one short operator-readable line per high-signal event (wizard stage transitions, CDC open + line state, HELLO timeouts with byte counts, discovery, peer transitions, bundle outcomes). Included in `couchlink bundle`. Survives across program restarts.
14-
- `couchlink bundle` captures the last 15 minutes of Windows event log entries from the System and Kernel-PnP/Configuration logs, filtered to USB-relevant providers. Catches driver-bind failures, surprise removals, and descriptor-request timeouts that pnputil cannot show.
15-
- Setup-mode CDC HELLO probe in `couchlink bundle` now uses a 10-second read deadline instead of 3 seconds. The wizard's faster budget still applies during interactive setup; the bundle path is "something is wrong, gather everything" and waits longer for late-arriving bytes from a slow-booting firmware.
16-
- `pico-diag.txt` now leads with a `Suggested next step` block: a one-sentence root cause and an ordered "Try this (in order)" list specific to the failure shape (write / read+0bytes / read+somebytes / decode / get_log_buffer / no_setup_port / setup_open_failed / no_last_pico_in_config / udp_discovery_failed / udp_probe_failed / udp_unsupported). The raw captured fields follow in a `Diagnostic details` block so an operator reading top-down hits an action before they hit jargon.
17-
- Bridge log files are no longer empty by default. The tracing filter directive matched a crate-name prefix that the binary's actual crate identifier did not satisfy, so every `info!` / `warn!` / `error!` call dropped silently on both stderr and the rotating file. `couchlink run` is no longer a silent console window; bundles now carry readable bridge logs.
18-
- `couchlink bundle` can now pull the firmware's diag-log ring over UDP from a running Pico. The bundle tries setup-mode USB-CDC first and falls back to a unicast UDP probe against the last-known address. `pico-diag.txt` and the manifest now name which source produced the log (`setup-cdc` or `run-udp`).
19-
- When CDC capture fails, `pico-diag.txt` now names the specific step that broke -- port enumeration, port open, HELLO write, HELLO read, or frame decode -- with bytes-received count and a hex dump of any pre-magic bytes seen on the wire. The previous stub said "couldn't capture, see the bridge log" without distinguishing which path failed.
20-
- `couchlink flash` refuses to write a UF2 whose family ID does not match the detected BOOTSEL drive. The previous behavior was a warning that continued the copy, which produced a Pico that silently never re-enumerated when an RP2040 image was dropped onto an RP2350 (or vice versa).
21-
- `couchlink setup` stage 4 waits up to 120 s (was 60 s) for the setup-mode CDC port to appear and prints a progress line every 10 s while it waits. The previous 60 s budget was tight when the host went through USB passthrough (VM, WSL2) or a first-time driver bind.
22-
- `couchlink setup` stage 4 treats a port-disappeared event right after `REBOOT_TO_RUN` as success rather than a hard error. The firmware always reboots after handling that command, so a missing reply is the expected outcome of a fast reboot, not a failure.
23-
- Firmware CDC `bcdDevice` follows the generated firmware build date, so Windows re-binds `usbser.sys` after a CDC-protocol break instead of reusing a cached binding from an older interface layout.
24-
- Release zip stages `setup.ps1`, `couchlink.exe`, and both board-specific UF2 files together.
25-
- Wiki pages now hold setup, flashing, troubleshooting, build, and protocol notes.
5+
See the repository changelog for the generated release list:
6+
7+
https://github.com/RealWhyKnot/ParsecCouchLink/blob/main/CHANGELOG.md
8+
9+
Latest published release:
10+
11+
https://github.com/RealWhyKnot/ParsecCouchLink/releases/latest
12+
13+
## Current Highlights
14+
15+
- `v2026.6.14.1` keeps provisioned Picos in run mode on normal replug so they enumerate as Xbox 360 controllers instead of falling back to setup-mode USB.
16+
- The no-argument guided menu opens on a **Basic** tab with one entry per saved or detected Pico. Each entry exposes only commands for that Pico, such as streaming, Wi-Fi setup, recovery, firmware flashing, USB diagnostics, saving, or removal.
17+
- Direct `couchlink run` can auto-recover setup-mode USB Picos that already have saved Wi-Fi by rebooting them back to Wi-Fi/controller mode and retrying discovery.
18+
- `couchlink debug` provides guided Pico recovery plus direct mode-switch commands for Wi-Fi/controller mode, USB debug mode, and BOOTSEL firmware mode.
19+
- `couchlink test usb` asks run-mode firmware over Wi-Fi for USB/XInput status, including mount/configuration state, descriptor counters, accepted IN reports, and host OUT traffic.
20+
- `couchlink lab` runs unattended plugged-in Pico bench scenarios, including `--power pnp-remove` for Windows PnP remove/rescan reconnect coverage.
21+
- `couchlink bundle` gathers logs, doctor output, Windows USB event-log snippets, bridge state journal entries, and firmware diagnostics when reachable by setup USB, vendor control, or run-mode UDP.
22+
- Release zips include `setup.ps1`, `couchlink.exe`, both board-specific UF2 files, support wrappers, and a manifest.

wiki/Hardware-Lab.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Hardware Lab
2+
3+
`couchlink lab` is an unattended bench harness for development and release
4+
checks. It is meant for plugged-in Picos on a Windows host, not for normal
5+
console play.
6+
7+
Run the current status snapshot first:
8+
9+
```powershell
10+
.\couchlink.exe lab --scenario status
11+
```
12+
13+
The status snapshot records visible setup-mode USB Picos, Wi-Fi/controller-mode
14+
Picos, BOOTSEL drives, Windows XInput slots, and problem USB devices.
15+
16+
## Scenarios
17+
18+
| Scenario | What it checks |
19+
|---|---|
20+
| `status` | Snapshot only; no mode changes. |
21+
| `mode-cycle` | Setup USB -> Wi-Fi/controller mode -> setup USB. |
22+
| `flash-cycle` | Setup USB -> BOOTSEL -> flash matching UF2 -> setup USB or Wi-Fi recovery. |
23+
| `power-cycle` | Selected reconnect backend only. |
24+
| `full` | Status, mode cycle, reconnect cycle, flash cycle, final Wi-Fi/controller check, and signal checks. |
25+
26+
Run the full scenario once:
27+
28+
```powershell
29+
.\couchlink.exe lab --scenario full --cycles 1
30+
```
31+
32+
By default, `--power auto` uses an external power backend only when one is
33+
configured and its probe command passes. Otherwise it falls back to firmware
34+
reset re-enumeration.
35+
36+
## Reconnect Backends
37+
38+
| Power value | Behavior |
39+
|---|---|
40+
| `auto` | Use configured external power only when its probe passes; otherwise use `reset`. |
41+
| `reset` | Reboot firmware between setup and run modes. USB power is not cut. |
42+
| `external` | Run configured off/on commands and wait for selected boards to disappear and return. |
43+
| `pnp-restart` | Use `pnputil /disable-device` and `/enable-device` on CouchLink setup USB instances. |
44+
| `pnp-remove` | Use `pnputil /remove-device <id> /subtree`, then `pnputil /scan-devices`, on CouchLink PnP instances. |
45+
46+
`pnp-remove` is the strongest built-in Windows reconnect simulation. During the
47+
full scenario it removes/rescans setup-mode USB instances, returns the Pico to
48+
run mode, verifies the XInput controller persona, removes/rescans that XInput
49+
PnP instance, then verifies Wi-Fi/controller detection and signal delivery
50+
again.
51+
52+
`pnp-remove` still does not physically cut USB power. Use an external power
53+
backend when the test must prove a real power loss or cable pull.
54+
55+
Example full reconnect run without reflashing:
56+
57+
```powershell
58+
.\couchlink.exe lab --scenario full --cycles 1 --power pnp-remove --no-flash --json .\lab-report.json
59+
```
60+
61+
## Select Boards
62+
63+
With no selector, the lab probes every visible Pico:
64+
65+
```powershell
66+
.\couchlink.exe lab --all
67+
```
68+
69+
Select one or more boards by UID, IP, or board name:
70+
71+
```powershell
72+
.\couchlink.exe lab --pico 07D37EB6 --pico 192.168.50.4
73+
```
74+
75+
## Firmware Inputs
76+
77+
The flash cycle resolves the matching UF2 for the detected board. Point `--uf2`
78+
at either a specific UF2 or a directory containing board-specific release files:
79+
80+
```powershell
81+
.\couchlink.exe lab --scenario flash-cycle --uf2 .\dist\ParsecCouchLink
82+
```
83+
84+
Use `--no-flash` when the bench should exercise mode and reconnect paths
85+
without writing firmware.
86+
87+
## External Power Backend
88+
89+
External power commands live in the per-user config file:
90+
91+
```text
92+
%APPDATA%\ParsecCouchLink\config\config.toml
93+
```
94+
95+
The command arrays use the first item as the executable and the remaining items
96+
as arguments:
97+
98+
```toml
99+
[lab_power]
100+
off = ["powershell", "-NoProfile", "-File", "D:\\tools\\pico-power.ps1", "off"]
101+
on = ["powershell", "-NoProfile", "-File", "D:\\tools\\pico-power.ps1", "on"]
102+
probe = ["powershell", "-NoProfile", "-File", "D:\\tools\\pico-power.ps1", "probe"]
103+
```
104+
105+
When `--power auto` is used, the probe must pass before the external backend is
106+
selected.
107+
108+
## Reports
109+
110+
Add `--json` to save a machine-readable report:
111+
112+
```powershell
113+
.\couchlink.exe lab --scenario full --power pnp-remove --json .\lab-report.json
114+
```
115+
116+
The JSON report records selected scenario, requested and selected power backend,
117+
visible devices, and each pass/fail/skip step with timing. A nonzero failure
118+
count makes the command exit with an error.

wiki/Home.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Console player 2
2727
- [[Controller Routing]] - choose which controller goes to which Pico.
2828
- [[Setup and Flashing]] - what the script does and how to recover a Pico.
2929
- [[Troubleshooting]] - what to run when setup or discovery fails.
30+
- [[Hardware Lab]] - unattended bench checks for firmware, reconnects, and controller output.
3031
- [[Reporting-Bugs]] - how to make a bundle and what to include in an issue.
3132
- [[Build]] - build the release zip from source.
3233
- [[Protocol]] - short runtime and setup protocol reference.
@@ -53,3 +54,7 @@ Console player 2
5354
7. Run `couchlink.exe`, choose the Pico on the **Basic** tab, start streaming, then start a Parsec session and play.
5455

5556
The Wi-Fi password is sent to the Pico over USB setup mode. It is not saved on the PC.
57+
58+
For development benches with the Pico plugged into the Windows host, `couchlink lab`
59+
can cycle setup mode, BOOTSEL flashing, run-mode controller enumeration, and
60+
signal checks. See [[Hardware Lab]].

wiki/Quick-Start.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Each subcommand also has a one-shot PowerShell wrapper in the release folder. Ri
103103
.\couchlink.exe debug --status # show whether the Pico is on Wi-Fi, USB debug, or BOOTSEL
104104
.\couchlink.exe debug --to-wifi --port COM3 # switch one USB debug Pico back to Wi-Fi
105105
.\couchlink.exe bootsel --port COM3 # switch one USB debug Pico to BOOTSEL
106+
.\couchlink.exe lab --scenario status # development bench status snapshot
106107
.\couchlink.exe test <name> # run one diagnostic check by name
107108
```
108109

wiki/Troubleshooting.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ The result tells you where USB stopped:
225225
- `configured, but the host has not accepted an XInput report`: unplug and replug the Pico, then update firmware if it repeats.
226226
- `host is polling the XInput endpoint`: the adapter accepted the Pico as a controller. Some adapters do not send rumble or LED OUT traffic until a game starts.
227227

228+
On a development bench where the Pico is plugged into the Windows host, use
229+
[[Hardware Lab]] for repeatable reconnect checks. `couchlink lab --scenario full
230+
--power pnp-remove --no-flash` removes and rescans the CouchLink setup and
231+
XInput PnP instances, then verifies Wi-Fi/controller detection and signal
232+
delivery after reconnect. It is still a Windows PnP simulation, not a physical
233+
power cut.
234+
228235
## Logs
229236

230237
Log location is printed by:

wiki/_Sidebar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
- [Controller Routing](Controller-Routing)
44
- [Setup and Flashing](Setup-and-Flashing)
55
- [Troubleshooting](Troubleshooting)
6+
- [Hardware Lab](Hardware-Lab)
7+
- [Reporting Bugs](Reporting-Bugs)
68
- [Build](Build)
79
- [Protocol](Protocol)
810
- [Changelog](Changelog)

0 commit comments

Comments
 (0)