# Headless Raspberry Pi environment implementation progress

Status: complete
Result: generic connector deployed and end-to-end dual-probe proof complete
Type: evidence
Updated: 2026-07-20
Next Action: normal use with repository-specific Windows target settings
Campaign Reason: Historical or workspace-maintenance record retained independently; no separate owner-queue execution is required.
Campaign: standalone

Parent: work/wp/completed/wp-headless-rpi-firmware-development-environment.md
Canonical Truth: E:/dev/high_point/7520553_SMI_FW/docs/headless-development-environment.md

## Safety boundary

Connector qualification initially remained probe-only. After the owner
explicitly authorized the end-to-end proof and stopped service 474 on A, the
approved Debug S-record was programmed and verified on both selected serials.
Both targets then passed a controlled hardware-breakpoint, step, detach, and
running-state check. Full details are in
`end-to-end-program-debug-proof-20260720.md`.

## Generic connector redesign

Owner clarification changed the Pi from an SMI-specific execution host to a
repository-independent physical connector. Commit `207e9713` implements the
new design:

- `/opt/jlink-hub` core knows only physical serials and Remote Server ports;
- configuration validation rejects device, interface, speed, firmware,
  repository, and project fields;
- each serial has an independent systemd Remote Server instance and lock;
- a generated nftables rule blocks direct non-loopback access to all configured
  ports;
- a Windows client installed outside firmware repositories opens the SSH
  tunnel by probe name or serial;
- SMI target/debug/program settings remain in Windows-only wrappers; and
- obsolete Pi SMI GDB/program services were removed from the repository.

## Generic hub deployment

- Final source and documentation were committed and synchronized cleanly on
  Windows and Pi at `5835d17ff29196da08cb8e382fd3429214957566`.
- Generic core installed root-owned under `/opt/jlink-hub`.
- Physical-only configuration installed under `/etc/jlink-hub` and accessible
  to the dedicated `jlinkhub` service user.
- `jlinkhub` is a supplementary member of `plugdev`; its inventory found both
  expected J-Link serials simultaneously and returned PASS.
- The obsolete `smi-jlink-gdb@.service` unit was retired.
- Both `jlink-remote@...` instances are enabled and active after qualification.
  The firewall service is enabled and active.
- nftables drops non-loopback TCP input to configured ports 19120 and 19121.
  A temporary harmless HTTP listener on port 19020 could not be reached
  directly at `10.1.2.124:19020`, but returned HTTP 200 through an SSH local
  forward. The temporary listener and tunnel were removed.
- A held serial lock caused the generic wrapper to reject a second owner with
  `J-Link 69664082 is already owned`; the test unit was stopped afterward.
- The Windows client was installed at `%LOCALAPPDATA%/JLinkHub` and, when run
  outside the firmware checkout, returned the Pi service state plus a passing
  dual-probe inventory.
- Incremental deployment bundles were retained with the migration evidence;
  `generic-hub-207e9713.bundle` has SHA-256
  `7330cc0f469cd2f74c06d28908b10ecaa5ef92766734476b34faa3a3ee3ef474`.

## SEGGER and dual-probe qualification

- The owner accepted SEGGER's Terms of Use and authorized V9.58 ARM64
  installation on 2026-07-20.
- Installed Debian package: `jlink 9.58.0 arm64`.
- Download SHA-256:
  `2bb951318b6792335f383dc7361d2de53e0d1797a073765a095974033275c29e`.
- The supplied `/etc/udev/rules.d/99-jlink.rules` was installed and refreshed.
- Port 19021 conflicted with a fixed internal SEGGER helper listener. Qualified
  endpoints were moved to 19120 and 19121, and probe selection was corrected
  to the V9.58 `-USB <serial>` option.
- Health checks inspect Linux listening state without creating a SEGGER client
  connection.
- The J-Link Plus timed out behind the VIA USB hub and disappeared after reset.
  Connecting both probes directly to separate Pi ports resolved it. Qualified
  sysfs locations are Plus `3-2` and Home V2 `1-2`; serials remain authoritative.
- Probe-only Commander sessions opened serials 69664082 and 69660123 and
  reported VTref 3.285 V and approximately 3.306 V respectively. Neither
  session issued a target `connect` command.
- Both Remote Servers ran concurrently. Parallel Windows V9.58 Commander
  clients connected through independent SSH tunnels and returned the correct
  serial for each endpoint.
- Direct Windows TCP connections to `10.1.2.124:19120` and `:19121` failed as
  required while SSH-forwarded connections succeeded.
- Restarting only the 69664082 service left both endpoints active and healthy.
- After enabling both units and rebooting the Pi, both probes inventoried,
  both services became active, both health checks passed, and no systemd units
  failed.

## Preservation

- Preserved source commit at start:
  `707c367c2f80532fd292462bd96aaf6238162bb5`.
- Complete Git bundle:
  `7520553_SMI_FW-20260720.bundle`.
- Bundle size: 83,401,713 bytes.
- Bundle SHA-256:
  `3fd44be2be7f7e7d0831b86465b7186afbe2e73fdb2156a7fd82739092082006`.
- Bundle verification reported complete history and passed on Windows and Pi.
- Windows Git integrity passed; reported dangling trees were recoverable
  unreachable objects, not corruption.

## Pi bootstrap

- Workspace created at `/home/jong/renesas/7520553_SMI_FW` from the verified
  bundle.
- Checkout fast-forwarded through implementation commit
  `1c2126d5bd87efb1f87bbbbd60804f5b8272662b`.
- Git status was clean after synchronization.
- Installed base packages include Git 2.47.3, Python 3.13.5, rsync 3.4.1,
  build-essential, curl, jq, usbutils, udev, and OpenSSH tools.
- No failed systemd units or reboot-required marker were present after package
  installation.
- Bench state directories were created under `/home/jong/renesas/bench` with
  owner `jong` and mode `0750`.
- `smi-jlink-gdb@.service` was installed but left disabled/inactive.

## Dual-probe inventory

Both expected probes were present simultaneously:

| Bench | Serial | Product | VID:PID | Sysfs |
| --- | --- | --- | --- | --- |
| Setup A | `69664082` | J-Link Plus | `1366:0101` | `1-1.3` |
| Setup B | `69660123` | J-Link Home V2 | `1366:0105` | `1-1.2` |

The repository and Pi copies of `probe_inventory.py` returned `PASS` with two
SEGGER devices. The same pair had previously survived an offline/reboot cycle.

## Windows canonical build and generation

- Isolated Windows e2 studio 2024-01.1 / SSP 2.6.1 Debug clean build passed.
- Isolated Windows e2 studio 2024-01.1 / SSP 2.6.1 Release clean build passed.
- Rebuilt stable/versioned artifact pairs passed the packaging hash checks.
- Debug S-record SHA-256 remained
  `8a3b43af3bc35922655db5216f4ed7c93aa829e03acc2fec65961b9232cdaa80`.
- Release S-record SHA-256 remained
  `a8a200d1e1134c3a0cabde61f5b9e8972a19f689bcf98dffd6758f5df5854f50`.
- A disposable generation probe withheld
  `src/synergy_gen/pin_data.c` and
  `synergy_cfg/ssp_cfg/bsp/bsp_pin_cfg.h`.
- The Windows headless e2 build recreated both files byte-for-byte and exited
  successfully.
- The generation-probe S-record was byte-identical to the canonical Debug
  S-record. Its ELF differed because debug information embedded the longer
  disposable staging path; the programmable S-record did not differ.

## Artifact and result transport

The Pi atomically accepted these freshly rebuilt clean-source packages:

- `7bcb47874b42-debug-20260720T164407Z`
- `7bcb47874b42-release-20260720T164423Z`

Each package contains the full Git commit/tree identity, configuration, pinned
tool versions, ELF/S-record/map sizes, and SHA-256 hashes. A generic dual-probe
inventory result was packaged on the Pi, returned to Windows, and its attachment
hash was verified.

## Wi-Fi tunnel

A temporary loopback-only HTTP listener was placed on Pi port 2331. Windows
opened the same SSH forwarding pattern used by Setup A and received HTTP 200
through `127.0.0.1:2331`. The temporary listener and SSH process were stopped
afterward. This proves SSH/Wi-Fi forwarding without opening or changing a
controller.

## Completion

The owner accepted SEGGER's Terms of Use, V9.58 ARM64 was installed, both
serial-bound services and the firewall passed reboot recovery, and both probes
passed programming/verify plus source-mapped GDB debugging. Windows and Pi are
clean and synchronized at
`9600ade4a17c95e000486666e9f6ac8dd2f3bef3`. No implementation gate remains.
