Validate independent RP2350 cores through one Arm owner. - #81
Merged
Merged
Conversation
Physical M33 evidence covered core 0, leaving core-1 access and independent halt behavior unverified. Add an opt-in two-counter bench over the two MEM-APs borrowed from one Arm owner, using existing target APIs and serialized calls. Require inactive, unrouted CTIs before acquisition. Check counter progress on the peer during each halt and step, then restore both targets before closing their shared memory owner. Retain that owner if target cleanup fails. Sequential stops do not imply an atomic snapshot or coordinated control. Include explicit RAM preparation and its effects: reset core 1, disable its Secure MPU for RAM entry, and replace volatile execution state. Image verification reads through both APs without running a target algorithm. Flash and inherited CTI routing are untouched.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Add an opt-in bench for two independently controlled Cortex-M33 targets borrowed from one
armdebug.Conn. It exercises RP2350 core 0 at AP0x2000and core 1 at AP0x4000, with separate RAM counters and serialized calls. Each target retains its own halt ownership and cleanup. Existing APIs suffice; library behavior is unchanged.For an already-open owner
c, acquire both targets and retain partial acquisition for cleanup. The caller supplies operationctxand a livecleanupCtx, including after cancellation:Why
The physical M33 evidence covered core 0. A second MEM-AP and processor do not by themselves establish independent control: inherited cross-trigger routing could couple their stops. This bench checks both CTIs before target acquisition and leaves their configuration untouched. Preparation also rejects conflicting debugger bank selection or missing Secure invasive debug permission before disabling core 1's Secure MPU. The test reads both counters during each observation window, so peer progress is measured while the selected core remains halted.
Both targets must release before their shared memory owner closes. If either target fails to release, the test retains the shared owner and reports which core needs cleanup. The test requests each halt separately; it does not provide a simultaneous halt, atomic memory snapshot, group ownership, or CTI coordination.
Hardware evidence
On Nostalgia, OpenOCD 0.12.0 prepared the supplied two-counter RAM image through J-Link EDU Mini V2
000802011345at 1 MHz. Its binary SHA-256 isbf878b47815bc5eaf6afb5279efaa6ff163832bd178c5b7b1604f80e6ad6cde9. Preparation resets core 1, replaces RAM at0x20040000–0x2004006f, disables core 1's Secure MPU for RAM entry, sets its Secure MSP, and replaces both cores' PC/XPSR/interrupt-mask state. All 28 image words are compared through both MEM-APs without running a target checksum algorithm. Flash, OTP, core-0 reset, and CTI routing are untouched; the previous volatile program state is not restored.Two fresh Ostiole sessions used one shared Arm owner each, CPUID
0x411fd210on both cores. Each read all 19 registers and checked one architectural step per core against PC/R0/RAM. Core 0's counter stopped while core 1 advanced, and the reverse held for core 1. After sequential halt requests both counters stopped; resuming only core 0 left core 1 stopped. Release from each owned halt restored counter progress.Both sessions restored initially disabled halting debug and running state on both cores before Arm owner close, with DHCSR
0x01100000before/after and DSCSR0x00030000unchanged. Both CTIs remained disabled and unrouted, with zero pending output/input-channel status and CTIGATE0x0funchanged. Both targets released and the shared owner closed successfully.The programs run in Secure Thread mode with configurable interrupts disabled. This does not exercise simultaneous stopping, CTI propagation or acknowledgement, Non-secure execution, sleeping instructions, or cross-core failure recovery. Per-target cleanup failures have behavioral coverage; this bench does not inject failures. State after Arm owner close was not independently measured. Both loops remain running, and their instruction effects and preparation are not undone.
Documentation
Add the two-core composition and bench procedure to the Cortex-M guide, record its scope in the capability table, architecture and composition guides, and README, and include the counter source, linker script, and explicit OpenOCD preparation.