Repository navigation
feat: unit firmware v0.1 (written, builds, not tested on hardware) - #5
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mdis 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.mdstates that a spectrum message'stsis 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
python -m pytest: 78 passed locally.Checklist
python -m pytestfeat:,fix:,docs:,test:,chore:)