Repository navigation
proto: split protocol contract, shared layout and POSIX PAL header - #9
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Version mismatch detection relies on mailboxes whose offsets can differ between the incompatible layouts being detected.
3 open findings
What changed in this PR
Introduces the shared M7/M4 split-protocol contract and SRAM4 layout.
Changes:
- Extends rate, arming, and core-status protobuf messages.
- Adds protocol constants, layout hashing, and transport registration.
- Adds POSIX declarations and layout tests.
| File | Description |
|---|---|
CMakeLists.txt |
Builds split-layout sources and test library. |
CubePilotFW/SplitLayout.cpp |
Registers per-core shared-memory groups. |
CubePilotFW/SplitLayout.h |
Defines slots, sizing, and layout hash. |
CubePilotFW/SplitProtocol.h |
Defines protocol constants and version. |
CubePilotFW/pal/Posix.h |
Declares POSIX shared-memory interface. |
proto/Common.proto |
Extends status and arming contracts. |
proto/Rc.proto |
Extends rate commands. |
tests/CMakeLists.txt |
Registers the layout test. |
tests/split_layout_test.cpp |
Tests layout invariants and transport direction. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ARMING_FLAG_FAILSAFE = 4; // Failsafe active | ||
| ARMING_FLAG_FAILSAFE_STAGE1 = 4; // M4: RateCommand stale > stage-1 threshold | ||
| ARMING_FLAG_FAILSAFE_STAGE2 = 8; // M4: latched descend | ||
| ARMING_FLAG_VERSION_MISMATCH = 16; // Peer protocol_version differs |
Member
Author
bugobliterator
changed the base branch from
docs/cuberacer-split
to
impl/cuberacer-m4
October 10, 2026 03:09
bugobliterator
force-pushed
the
proto/split-contract
branch
from
October 10, 2026 03:10
90f24f9 to
f580cee
Compare
bugobliterator
force-pushed
the
proto/split-contract
branch
from
October 10, 2026 03:21
f580cee to
9ffc53e
Compare
(cherry picked from commit 90f24f9)
CoreInfo, ArmingState and RateCommand sizes come from their field options. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
The previous asserts compared each envelope against the message it contains, which nanopb guarantees. Check each envelope plus frame header against its slot size, each slot against the layout end, and the layout end against the receiver region. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqxcxgduRYDCp2rs1XqK5M
bugobliterator
force-pushed
the
proto/split-contract
branch
from
October 10, 2026 03:41
9ffc53e to
93a111a
Compare
Comment on lines
+48
to
+52
| assert(m7.send(kRc.groupId, payload, sizeof(payload)) == 0); | ||
| uint8_t out[64]; | ||
| size_t len = 0; | ||
| assert(m4.receive(kRc.groupId, out, sizeof(out), &len) == 0); | ||
| assert(len == 4 && out[3] == 4); |
Member
Author
There was a problem hiding this comment.
Reverse duplex coverage (M4-TX/M7-RX mappings) is added at the top of this stack in #18, to avoid re-cascading the whole chain for a test-only change.
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.



RateCommand/ArmingState fields for the split, CubePilotFW/SplitLayout.h (shared SRAM4 layout, kLayoutHash 0xED77D04D), SplitProtocol.h constants and the POSIX PAL header.