feat(rti): MSS RTI driver implementation and host unit tests #117
No reviewers
Labels
No labels
Category
App
Category
Documentation
Category
Firmware
Category
Hardware
Category
Qms
PR_Size
L
PR_Size
M
PR_Size
S
PR_Size
XL
PR_Size
XS
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Priority
Very Low Priority
Size
Epic
Size
Feature
Size
Task
Status
Blocked
Status
Draft
Status
Needs-review
Team
Board
Team
Dev
Team
Management
Type
Bug
Type
Capa
Type
Improvement
Type
New-feature
Type
Regulatory
Type
Usability
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
opendutchsolutions.public/hal_awr6843!117
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/116-mss-rti-driver"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Adds
hal/mss/rti/hal_rti.c/.h— driver for the two MSS-side RTI (Real-Time Interrupt) timer instances,MSS_RTIAandMSS_RTIB(TRM Table 4-2).MSS_RTIAis a plain free-running timer;MSS_RTIBis the same Hercules RTI IP block additionally wired as the device's Digital Watchdog Timer. Mirrors the already-landed DSS RTI driver's (#113/#114) scope: counter block 0 / compare channel 0 only — no watchdog-mode registers, no counter block 1 / compare channels 1-3, no external NTU timebase/capture, no DMA-request wiring.Unlike DSS, MSS interrupts route through the VIM — this driver adds a real VIM-dispatched raw handler,
RTI_COMPARE0_IRQHandler()(VIM channel 2,RTI_COMPARE0_IRQn), acknowledgingRTIINTFLAG.INT0and forwarding to a weak, application-overridablehal_rti_irq_handler()hook, plus a newcaseinhal_vim.c's dispatch switch. This handler is scoped toMSS_RTIAonly —MSS_RTIB's compare-0 interrupt routes through the differently-numberedWDT_REQ0_IRQn(channel 10) instead, per its watchdog wiring.Also adds
fake_mss_rtia/fake_mss_rtibhost-test register shims (theRTIA/RTIBtyped macros had no fake backing before this PR).Caller-facing safety note, documented in the header: because
MSS_RTIBis the device's live watchdog block, calling this driver's generic counter-block-0 functions againstHAL_RTI_Bshares hardware with whatever watchdog configuration is (or isn't) active on that instance — this driver does not itself arm, disarm, or otherwise know about the watchdog.Why
Completes MSS/DSS RTI driver parity, and is a direct prerequisite for the barebones MSS example project currently being scaffolded, which needs a real periodic interrupt source to demonstrate the VIM dispatch chain.
Related Issue
Closes #116
Type of Change
Impact Assessment
MSS_RTIB-is-also-the-watchdog caveat is a genuine, documented risk boundary (not a defect) — this driver deliberately does not touch watchdog-mode registers and calls out the shared-hardware hazard explicitly.Testing
testing/mss/unit/hal_functionality/test_rti_functionallocally (6 test cases, 67 assertions, all passing) alongside the full existingctestsuite (398/398 passing, no regressions), plus confirmedtest_vim_functional/test_vim_dispatchstill link and pass withhal_rti.c; ran a full MISRA C:2025 pass (0 unsuppressed findings,-DENABLE_RTI_MODULEadded); reformatted and re-verified against the exact clang-format 18.1.3 the CI runner uses. Sanity-checked by swappingRTI_COMPARE0_IRQHandler()'s target instance fromHAL_RTI_AtoHAL_RTI_B— the first version of the test suite didn't catch this (it only asserted RTIA's flag state, which a write-1-to-clear fake can't tell apart from "written again"), so the test was fixed to also assert RTIB stays untouched before re-running the sanity check, which then correctly failed (1 assertion) and was reverted.PR Size
Size justification / exemption (if L or XL):
669 raw lines across 13 files, all hand-reviewed (no mechanically-generated content). Not split further — the driver (
hal_rti.c/.h, 376 lines) and its Catch2 spec (test_rti.c, 253 lines) don't decompose into independently-reviewable sub-PRs, same rationale as every prior driver PR in this project. The remaining files are small CMake/Kconfig/MISRA/VIM-dispatch wiring diffs, also not independently reviewable apart from the driver they enable.Checklist
type(scope): descriptionconvention withRelates to #<issue>footerSummary
hal/mss/rti/hal_rti.c/.h: MSS RTI driver — init/bring-up, periodic-rate configuration, start/stop, interrupt-flag clear,RTI_COMPARE0_IRQHandler()for bothRTIA/RTIBinstanceshal/mss/vim/hal_vim.c: newRTI_COMPARE0_IRQndispatch casetesting/mss/unit/hal_functionality/test_rti.c(+CMakeLists.txt, target namedtest_rti_functionalto avoid a collision withti_hal_comparison/test_rti.c): Catch2 functional test suitetesting/support/fakes/registers/awr.h/hw_fakes.c: newfake_mss_rtia/fake_mss_rtibregister shimszephyr/Kconfig/zephyr/CMakeLists.txt/hal/util/hal_config_mss.h/template/hal_config_mss_template.h:HAL_AWR6843_RTIKconfig option andENABLE_RTI_MODULEbridgetools/misra/run_misra.sh:-DENABLE_RTI_MODULEadded