feat: harden STM32 firmware, add CI and CAN control - #2
Closed
seofernando25 wants to merge 3 commits into
Closed
Conversation
Author
|
Holy slop |
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.
Summary
This PR establishes a compile-, test-, and CI-protected C/libopencm3 firmware baseline for each STM32F072R8T6 receiver-chain board and adds the CAN functionality needed for a Raspberry Pi plus multiple receiver nodes.
The repository remains intentionally scoped to per-board firmware:
Beam steering, calibration strategy, and coordination across several receiver boards belong in a separate controller-side repository.
CAN implementation
Versioned wire protocol
0.1..30.31.0.Supported commands:
ENTER_SAFESET_COMBINEDSET_PHASESET_VGAPINGResponses:
STATUSACKERRORBroadcast commands do not generate responses, avoiding an acknowledgement storm.
Safe output sequencing
SET_PHASEapplies 23 dB attenuation before a phase change when necessary, then restores the previous attenuation.SET_COMBINEDapplies23 dB → phase → requested attenuation.ENTER_SAFEapplies 23 dB and phase state zero.CAN transport
Node-specific images
The node ID is compiled into the image:
Valid IDs are
1..30; invalid values fail compilation. The retained build identity hashes both the Git revision and node ID.CI builds and uploads images for nodes 1, 2, and 3 for the planned Raspberry Pi bench test.
Raspberry Pi test tool
tools/can_smoke_test.pyis a dependency-free SocketCAN client supporting:The complete identifier layout, payloads, status flags, Pi setup, and three-node test sequence are documented in
docs/CAN_PROTOCOL.md.Existing hardening included in this PR
Build and target alignment
Phase and VGA correctness
0x092c.0x5c.Fault containment
.noinitdiagnostic record.Verification
The complete gate passes in Ubuntu 24.04:
Exact final revision:
Each node image embeds that revision and uses:
Hardware validation still required
This PR is software-verified, not CAN-bus or RF-hardware-validated. Before operational use, complete
docs/HARDWARE_VALIDATION.md, including:Points to confirm during project rundown
The protocol is versioned so those decisions can be incorporated without importing the unfinished
CANDevimplementation or silently changing deployed frames.