feat(vim): VIM driver implementation and host unit tests #104
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!104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/103-vim-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/vim/hal_vim.c— the VIM (Vectored Interrupt Manager) driver implementation, completing the header-only stub landed with ESM (#77/#78).hal_vim_init()resets the VIM and masks every channel;hal_vim_set_priority()/hal_vim_enable()/hal_vim_disable()configure per-channel IRQ/FIQ routing and arm/mask individual channels; the non-weakIRQ_Handler()/FIQ_Handler()decodeVIM_IRQINDEX/VIM_FIQINDEXand forward to the weakhal_vim_process_irq()/hal_vim_process_fiq()hooks, whose default implementations are a fixed per-channel dispatchswitchrouting to every landed peripheral's own named raw device handler (ESM, GPIO, UART, SPI, I2C, MCAN/MCANB, DMM1/DMM2, CBUFF, EDMA_TPCC0/TPTC0/TPTC1, Mailbox).This driver was deliberately deferred — its dispatch table references handler symbols from ten other drivers, so it couldn't link (let alone be meaningfully tested) until all of them landed. With EDMA (#101/#102) — the last dependency — merged, every symbol the switch references now exists.
Why
Completes the interrupt-dispatch infrastructure now that every peripheral driver it routes to (GPIO through EDMA) is landed.
Related Issue
Closes #103
Type of Change
Impact Assessment
Testing
testing/mss/unit/hal_functionality/test_vim_functional(7 test cases, 69 assertions) andtest_vim_dispatch(3 test cases, 18 assertions) locally, all passing, alongside the full existingctestsuite (353/353 passing, no regressions); ran a full MISRA C:2025 pass (0 unsuppressed findings — VIM has noENABLE_VIM_MODULEopt-in guard, it's core infrastructure); reformatted and re-verified against the exact clang-format 18.1.3 the CI runner uses; sanity-checked by changinghal_vim_init()'sREQENACLRmask loop bound from 4 to 3, confirming the test suite fails (1 assertion), then reverting.PR Size
Size justification / exemption (if L or XL):
847 raw lines across 4 files, all hand-reviewed (no mechanically-generated content). Not split further — the driver (
hal_vim.c, 325 lines) and its two Catch2 test targets (test_vim.c/test_vim_dispatch.c, 473 lines combined, coveringIRQ_Handler()/FIQ_Handler()'s decode-and-forward logic and the real dispatch switch's per-channel routing — a hard C-linkage constraint requires two separate targets, see the CMake wiring comments) don't decompose into independently-reviewable sub-PRs. The CMake wiring diff is larger than usual for this project since every driverhal_vim.c's switch references by symbol name needs linking into both test targets, even though most of that switch is unreachable intest_vim_functional.Checklist
type(scope): descriptionconvention withRelates to #<issue>footerSummary
hal/mss/vim/hal_vim.c: VIM driver (init/reset, priority/enable/disable,IRQ_Handler/FIQ_Handler, default dispatch switch)testing/mss/unit/hal_functionality/test_vim.c(+ CMake): overrides the weak dispatch hooks with a strong recorder to testIRQ_Handler()/FIQ_Handler()in isolation. Namedtest_vim_functional(nottest_vim) to avoid a CMake target-name collision withti_hal_comparison/test_vim.c.testing/mss/unit/hal_functionality/test_vim_dispatch.c(+ CMake): links the real (non-overridden) dispatch switch to exercise its actual per-channel routing. No naming collision.