Repository navigation
docs(platforms): mandate vendor CMSIS PAL for register maps - #3350
Conversation
Two LPC845 register-offset bugs (issue #2990, fix PR #3349) traced back to hand-rolled `FL_LPC_*_Shim` structs whose offsets disagreed with NXP's `LPC845.h`. The bugs were invisible at compile time and only surfaced when contributors scoped the GPIO pin and noticed the LED pattern was wrong. Land documentation so future agents and contributors prefer vendor headers: - `agents/docs/register-maps.md` — new doc with the rule, why hand-rolled shims fail, a vendor-source table (NXP/ST/Nordic/Atmel/RPi/SiLabs/PJRC CMSIS repos with licenses), a tier-1/2/3 integration pattern, a reviewer checklist, and the LPC845 worked anti-example. - `CLAUDE.md` — new row in "Read the Right File for Your Task" pointing at the new doc. - `.claude/agents/platform-port-agent.md` + `.claude/skills/platform-port/SKILL.md` — cross-reference the doc before any peripheral struct is authored. - `src/platforms/arm/lpc/README.md` — pin the lesson at the scene of the crime; flag the existing shims as tier-3 fallbacks and tee up the longer-term tier-2 fix (vendor `LPC845.h` into `src/platforms/arm/lpc/cmsis/`). Closes the documentation gap behind issue #2990's "AI hallucinated register maps" comment. No code changes — follow-up PR will land the tier-2 LPC845 vendoring. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds ChangesRegister-map policy and agent wiring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Two LPC845 register-offset bugs (issue #2990, fix PR #3349) traced back to hand-rolled
FL_LPC_*_Shimstructs insrc/platforms/arm/lpc/clockless_arm_lpc_pwm_dma.hwhose offsets disagreed with NXP'sLPC845.h. Both were invisible at compile time and only surfaced when contributors scoped the GPIO pin. The contributor put it bluntly: "This seems like a waste of time debugging AI hallucinated register maps, when it would be so much easier and safer to use the vendor provided CMSIS Peripheral Access Layer."This PR lands the documentation gap that allowed those bugs to ship:
agents/docs/register-maps.md(new) — the rule, why hand-rolled shims fail, a vendor-source table (NXP / ST / Nordic / Atmel / RPi / SiLabs / PJRC CMSIS repos with licenses), a tier-1/2/3 integration pattern, a reviewer checklist, and the LPC845 worked anti-example.CLAUDE.md— new row in "Read the Right File for Your Task" pointing at the new doc, so it shows up in the routing table every agent reads at session start..claude/agents/platform-port-agent.md+.claude/skills/platform-port/SKILL.md— cross-reference the doc before any peripheral struct is authored, with the LPC845 incident cited inline.src/platforms/arm/lpc/README.md— pin the lesson at the scene of the crime; flag the existing shims as tier-3 fallbacks and tee up the longer-term tier-2 fix (vendoringLPC845.hintosrc/platforms/arm/lpc/cmsis/).No code changes in this PR — a follow-up will land the tier-2 LPC845 vendoring and delete the shims.
Test plan
agents/docs/register-maps.mdrenders cleanly (Markdown only).bash compile/bash testimpact.Closes the documentation gap behind issue #2990's "AI hallucinated register maps" comment.
Related: #2990, #3349
🤖 Generated with Claude Code
Summary by CodeRabbit