hal: microchip: add the USART SWRST alias the four mapping packs lack #73
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
Madhan-Kurukondar
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 ownSERCOM_USART_INT_ones -sercom_pic32cm_jh.h,sercom_pic32cx_sg.h,sercom_pic32cz_ca.handsercom_samd5xe5x.h- forty-seven definitionsapiece, and
CTRLA_SWRSTis in none of them. Only the PIC32CM SG/GC and PLpacks 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.cnever reset a SERCOM.Why now
The Zephyr change
serial-mchp-sercom-resetadds exactly that: a USARThanded 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
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.
SWRSTis bit 0 ofCTRLAin both the INT andthe 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_worldonpic32cm_jh01_cproandsam_e54_xpro, with theZephyr 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 onpic32cm_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'sserial-mchp-sercom-reset, and it has to landin the same window or that change breaks four families.