← Back to Pull requests

hal: microchip: add the USART SWRST alias the four mapping packs lack #73

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

uart_mchp_sercom_g1.c is gaining a SERCOM software reset for a USART the bootloader handed over enabled, and the generic name it uses is defined natively only by the SG/GC and PL packs, so the four packs that map the generic USART names need the missing alias or the change breaks every other in-tree user of the driver.

One name missing from forty-seven, four times over

Four pack headers map the generic SERCOM_USART_ names onto their own
SERCOM_USART_INT_ ones - sercom_pic32cm_jh.h, sercom_pic32cx_sg.h,
sercom_pic32cz_ca.h and sercom_samd5xe5x.h - forty-seven definitions
apiece, and CTRLA_SWRST is in none of them. Only the PIC32CM SG/GC and PL
packs spell it natively, because their SERCOM has a single USART register
view rather than an INT/EXT pair.

Nothing noticed, because uart_mchp_sercom_g1.c never reset a SERCOM.

Why now

The Zephyr change serial-mchp-sercom-reset adds exactly that: a USART
handed over by a bootloader arrives still enabled, and an enable-protected
register cannot be written in that state, so the driver disables and then
software-resets before configuring. The line it needs is

usart_regs->SERCOM_CTRLA = SERCOM_USART_CTRLA_SWRST_Msk;

which compiles on this board's family and on nothing else.

Evidence

| Board | Before | After |
|---|---|---|
| pic32cm_jh01_cpro | 'SERCOM_USART_CTRLA_SWRST_Msk' undeclared | links |
| sam_e54_xpro | 'SERCOM_USART_CTRLA_SWRST_Msk' undeclared | links |
| pic32cm_gc00_cpro | links | links |

Scope

One line per header, four headers, the same one-line form as the
forty-seven already in each. SWRST is bit 0 of CTRLA in both the INT and
the EXT register view of every one of these packs, so mapping to the INT
spelling - which is what all forty-seven neighbours do - is the same bit
either way. Nothing that compiles today changes meaning.

Testing

samples/hello_world on pic32cm_jh01_cpro and sam_e54_xpro, with the
Zephyr serial patch in the tree, before and after. No board of any of these
four families is on this bench, so the rung that could watch the reset
happen is UNVERIFIED; the reset itself is measured on
pic32cm_gc00_cpro, which does not need this change.

Verification

Built in the project's dev container, whose west workspace applies this
change as a module patch. This is the consumer-side pair of
zephyrproject-rtos/zephyr's serial-mchp-sercom-reset, and it has to land
in the same window or that change breaks four families.

Diff: 312 lines (+234 / -78) across 3 files Reviewer: Madhan-Kurukondar Review duration: 10907m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 312 lines diff across 3 files
0.40
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.344
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #73"
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: 40.3% (MEDIUM) · Higher = larger blast radius
40.3%
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: 15.9% · Safe to merge
15.9%