Repository navigation
fix(stm32): defer legacy debug registers to CMSIS 6 - #4410
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe STM32 register fallback now defers to CMSIS definitions, avoids comparator macro collisions, and supports legacy layouts. The clockless driver enables DWT tracing through CMSIS 6 ChangesSTM32 CMSIS compatibility
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The STM32 CMSIS compatibility changes have no remaining actionable merge risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
Fixes #4408.
Including FastLED on the Zephyr-based Arduino Uno Q reaches the legacy STM32 register fallback even though CMSIS 6 has already declared
CoreDebug_TypeandDWT_Type. CMSIS 6 does not define the oldCoreDebug_BASEguard, and STM32 HAL'sCOMP1/COMP2macros also expand inside the fallback struct.Suppress the fallback when a CMSIS core or existing register base is present, preserve the legacy layout while prefixing its comparator member names, and prefer CMSIS 6's
DCBfor trace enable with the olderCoreDebugpath retained. Add host regressions for CMSIS suppression, macro coexistence, and legacy register offsets/sizes. No new register maps or dependency changes.Validation:
bash test --cpp: baseline 305/305 unit tests and 84/84 examples passed; after the fix, 2/2 affected unit tests passed, with unchanged tests/examples cached.LD_LIBRARY_PATH.bash lint: passed (one existing JavaScript warning); code review found no blocking issues.bash compile arduino_uno_q --examples Blink: baseline passed, 40,943 bytes flash / 4,032 bytes RAM. This target is an STM32duino surrogate, not ArduinoCore-zephyr./tmpprobe cross-compiled ST's actual STM32U585 device PAL with its core include redirected to Arm CMSIS 6.1.0. Including the original fallback reproduced both typedef conflicts and the HAL comparator syntax errors. The patched fallback passed: 25,812 bytes flash / 3,344 bytes RAM.The actual Zephyr Arduino core and physical Uno Q were not tested. The vendor-header probe validates the reported CMSIS/HAL collision with real headers and the ARM toolchain; it does not establish hardware timing behavior.
The CMSIS 6 probe also passed with
CMSIS_DISABLE_DEPRECATEDand source assertions requiringDCBpresent /CoreDebugabsent:bash compile arduino_uno_q --examples /tmp/fastled-4408-probe --defines CMSIS_DISABLE_DEPRECATED, rebuilt successfully in 23.8s (25,812 bytes flash / 3,344 bytes RAM). The initial flag-only invocation reused cached artifacts, so the source assertion forced actual recompilation. Absolute example paths also caused a nonfatal build-metadata filename warning; firmware compilation/linking succeeded.Summary by CodeRabbit
Bug Fixes
Documentation