fix: recognize P4 SPM stacks in flash guard - #42
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 12, 2026, 1:25 AM ET / 05:25 UTC (Revision 5). ClawSweeper reviewWhat this changesAdds a verified ESP-IDF patch that accepts internal SPM task stacks during Tab5 flash operations, with isolated CI application, firmware provenance, documentation, and refusal tests. Merge readiness⛔ Blocked before merge - 2 items remain Still needed and suitable to land: main lacks the compatibility fix, no actionable patch defect was found, and the recorded maintainer disposition resolves both prior review follow-ups. Priority: P2 Review scores
Verification
How this fits togetherTab5 firmware uses ESP-IDF to access flash for operations such as session persistence. This change adjusts the SDK’s stack safety check and records the exact patched SDK identity in downloadable firmware artifacts. flowchart TD
A[Tab5 CI build] --> B[Verify SDK and patch identity]
B --> C[Apply isolated compatibility patch]
C --> D[Build firmware]
D --> E[Verify SDK delta and package artifacts]
D --> F[Device flash operation]
F --> G[Accept internal SPM stack]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the exact SDK identity guard under the accepted interruption policy, then retire the compatibility patch when an upstream-fixed SDK is selected and qualified. Do we have a high-confidence way to reproduce the issue? Yes, the source establishes the failure path: a valid internal SPM task stack reaches a flash predicate that accepts only DRAM/optional RTC memory. This review did not execute a current-main hardware reproduction. Is this the best way to solve the issue? Yes. Extending only the flash predicate preserves existing allocation and assertion behavior; the exact-source checks keep the local SDK exception narrow and auditable. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against d7c4a40fc71c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Problem
On the connected M5Stack Tab5 ESP32-P4 v1.3, flash access asserted at
cache_utils.c:127with a task stack pointer inside internal SPM. The selected ESP-IDF base accepts SPM for internal allocations but omits it from its flash-operation stack-sanity predicate. This matches espressif/esp-idf#19020.Stacked on #41 to retain the exact normal ELF/map alongside the firmware. This does not merge any dependency PR.
Changes
SOC_MEM_SPM_SUPPORTED-guardedesp_ptr_in_spm(sp)case to the stack-sanity predicate. Keep the assertion, DRAM/RTC checks, allocation policy, NVS behavior, and chip-revision selections unchanged.362a1776ec212788fda95f75b733bfdde3a0c394, the exact tracked patch, the original whole-file hash, and the exact resulting source hash. Reject unrelated tracked/untracked changes, another base, staged changes, and tampering. Verify an already-applied exact patch without reapplying it.Original Checks
git diff --checkpassed.c8e63f6b5510156ba1b12dc4e916031823a39056, including Tab5 firmware and symbol uploads.10042137041and10042137904). All 11 firmware and 3 symbol checksum entries passed; the four images retain offsets0x2000,0x8000,0x10000, and0x810000.2949820b310a0e14d3317fd1ffb37f9f6fadd4c0, with the expected PR/base parents and the same tree as the PR head.3ca692fc85a1259414e8f9cc9ca571fdfe47feaed08b6f96e11559a54c5ad9a3. Embedded app version2949820and SDK revision match the manifest.Qualification Limits
Matched firmware/symbol download verification passed. The manifest records SDK base
362a1776ec212788fda95f75b733bfdde3a0c394, revisionv5.5.5-648-g362a1776ec2-dirty, and the exact approved patch/source hashes. The SDK base matches the preceding build, but its source now includes the tracked compatibility patch. The image selector remains moving and the helper fails closed if its base changes.The affected connected board is P4 v1.3. Current profile/image evidence (
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y, image minimum revision 0, maximum 199) does not establish same-binary revision 3 or newer compatibility. These checks do not qualify other P4 revisions or the new ancestry-prepared image physically. The existing defaults comment suggesting "newer silicon" needs a separately qualified correction; this change does not alter revision selections.No device access, flashing, USB-JTAG, Gateway, or provider calls were performed for this implementation. A successful build would not by itself prove that the observed assertion is resolved on hardware.
Landing Preparation
Signed head
ba3437946360327d5e6c7dc386ad9fe50a7f9ce2retains the originalSPM compatibility commit and incorporates the reviewed predecessor
1d1c83af134b16824cbbeec940f834419c1e51ba. Its complete tree is exactly thatpredecessor plus the original compatibility delta, preserving the landed
release guard and node-home repair. No new SDK patch or runtime policy was
introduced. All five builds passed in
exact-head CI run 34507229544;
the artifact evidence above belongs to the original build.
Maintainer disposition on September 12, 2026: accept the narrow compatibility
fix and its intentional fail-closed refusal when the moving SDK selector stops
matching the approved base. SDK pinning is separate work; this PR does not
weaken the identity guard to keep builds running.
Separate campaign evidence on the matched
2949820image recorded four flashreadbacks, successful node-session persistence and 60 seconds without the SPM
assertion or reset. Later operator/NVS failures remained separate unresolved
outcomes; this is not complete storage, other-silicon, or voice qualification.
No new hardware test was performed for this ancestry-prepared head. Landing
uses a merge commit and retains the original signed objects.