Skip to content

feat: unit firmware v0.1 (written, builds, not tested on hardware) - #5

Merged
mohanvd merged 8 commits into
mainfrom
firmware-v0.1
Oct 10, 2026
Merged

mohanvd merged 8 commits into
mainfrom
firmware-v0.1

Conversation

@mohanvd

@mohanvd mohanvd commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

What this changes

Adds the Invigil unit firmware v0.1 for the Raspberry Pi Pico 2 W (Pico SDK 2.3.1, C, CMake), host tests for the parts that do not need the SDK, and a real firmware job in CI.

Docs: docs/firmware.md is now the build, flash and first boot guide. The README has the firmware status, wiring with physical pin numbers for the bare module and the adapter board, and the adapter in the parts list. docs/contract.md states that a spectrum message's ts is the end of its scan window.

Status: written and builds in CI. Not tested on hardware. The board has not arrived.

How it was tested

  • Host tests and contract check: run in CI (no C compiler on the dev machine).
  • Firmware build for pico2_w: run in CI.
  • python -m pytest: 78 passed locally.

Checklist

  • Tests pass: python -m pytest
  • No raw data or secrets: no raw captures, MAC addresses, salts, Wi-Fi or MQTT credentials
  • Docs updated where behavior, commands or formats changed
  • Commit messages follow conventional commits (feat:, fix:, docs:, test:, chore:)
  • Nothing in this change makes the unit transmit

Plain C with no Pico SDK includes, so it builds and tests on a PC:
SHA-256 and the salted address hash, manufacturer ID parsing from
advertising data, JSON builders that refuse anything off-contract,
spectrum hit counting, the BLE reading buffer, and a receive-only
nRF24L01+ driver behind a small hardware interface.
The host test program checks SHA-256 against the standard vectors, the
hash test vector in both byte orders, manufacturer ID parsing, the JSON
builders, spectrum counting, the ring buffer, and the nRF driver against
a fake radio that fails on any transmit command. It also writes sample
messages that check_contract.py runs through server/contract.py.
Pico SDK 2.3.1, C, CMake, board pico2_w. Modules: config, wifi_sta
(station, reconnect backoff, SNTP clock), mqtt_link (lwIP MQTT, QoS 0,
waits on ERR_MEM), ble_scan (BTstack passive observer, hashed addresses,
boot self-check with the test vector), nrf_scan (receive-only sweep of
126 channels) and main (scan, send and quiet windows, watchdog, LED,
10 s summary on USB serial).

Written and built only. Not tested on hardware.
Installs the Arm GNU Toolchain and the Pico SDK at the versions pinned in
firmware/CMakeLists.txt, checks the toolchain download against Arm's
SHA-256, builds for pico2_w with placeholder secrets and uploads the
.uf2. Runs the host tests with sanitizers and checks the sample
payloads with server/contract.py.
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
invigil-demo Ready Ready Preview Oct 10, 2026 9:38am UTC

The Pico SDK always compiles BTstack's HCI dump to stdout, which needs
ENABLE_PRINTF_HEXDUMP. lwIP's mqtt.h defines its own MQTT_PORT, so keep
the port from secrets.h under another name before including it.
@mohanvd
mohanvd marked this pull request as ready for review October 10, 2026 09:42
@mohanvd
mohanvd merged commit 7314315 into main Oct 10, 2026
7 checks passed
@mohanvd
mohanvd deleted the firmware-v0.1 branch October 10, 2026 09:42

This branch was successfully deployed

1 active deployment
Preview — ccc793b0 Deployed Oct 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant