← Back to Pull requests

hal: microchip: pic32c: add the two SPI aliases the JH pack lacks #74

Closed
unknown closed this pull request without merging on Aug 27, 2026 02:53 UTC
View on GitHub
unknown unknown commented on Aug 19, 2026 13:01 UTC
Author

The SPI driver's four SERCOM_SPIM_ references only compile on packs that spell that prefix; making the driver use the generic SERCOM_SPI_ names (the Zephyr side of this pair) needs three aliases the JH pack never defined.

Two names missing from forty

sercom_pic32cm_jh.h maps the generic SERCOM_SPI_ names onto this pack's
SERCOM_SPIM_
ones - some forty definitions - and two of them are absent:
CTRLA_SWRST and SYNCBUSY_SWRST.

Nothing noticed, because spi_mchp_sercom_g1.c reached past the mapping and
used the SPIM spelling directly in exactly those places. That direct use is
what stops the driver building on PIC32CM SG/GC, which has one SPI block
and no SPIM prefix at all.

The third name is deliberately not here

The driver's fourth direct use is SERCOM_SPIM_CTRLC_ICSPACE, and this pack
has no SPIM CTRLC register at all - aliasing it would point a definition
at a name that does not exist. It is also unreachable:
SPI_MCHP_INTER_CHARACTER_SPACE is depends on
SOC_FAMILY_MICROCHIP_SAM_D5X_E5X
, so on a JH build the symbol is not in
autoconf.h and the #ifdef around that line is false. That name belongs
in sercom-d5x-e5x-spi-aliases, where the register and the Kconfig both
exist.

Scope

Two lines, of the same one-line form as the forty already in the file. No
pack header other than this one is touched, and nothing that compiles today
changes meaning.

Testing

With this branch applied to the workspace's hal/microchip module, and the
Zephyr change that moves the driver onto the generic names,
samples/hello_world with CONFIG_SPI=y compiles spi_mchp_sercom_g1.c
for pic32cm_jh01_cpro.

CONFIG_SPI_MCHP_INTER_CHARACTER_SPACE=1 is not part of that build and
cannot be: the symbol's depends on excludes this family, so passing it on
the command line is dropped and it never reaches autoconf.h. An earlier
record of this rung claimed otherwise; the CTRLC line is compiled on
sam_e54_xpro, under sercom-d5x-e5x-spi-aliases, and nowhere else.

Verification

Built in a west workspace at Zephyr main with this module substituted in.
This is the JH half of zephyrproject-rtos/zephyr's
spi-mchp-sercom-g1-generic-names. The Zephyr change stands on its own for
SG/GC, whose pack defines these three names natively in
component/sercom.h and never includes this header - measured on the GC00
build, whose dependency graph names sercom_pic32cm_sg_gc.h and not
sercom_pic32cm_jh.h. Without these six lines it is the JH build that stops
compiling, so the two must land together to keep JH working.

Diff: 323 lines (+242 / -81) across 4 files Reviewer: Madhan-Kurukondar Review duration: 10912m
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 323 lines diff across 4 files
0.42
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.346
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #74"
general weight: 0.35
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 42.0% (MEDIUM) · Higher = larger blast radius
42.0%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 16.6% · Safe to merge
16.6%