fix(PeriphDrivers): Skip GPIO init in MAX78002 SPI when MSDK_NO_GPIO_CLK_INIT is defined #1651
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 219 lines diff across 2 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.323
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1651"
general
weight: 0.35
ttmut
Description
On MAX78002,
MXC_SPI_Init()inspi_ai87.calways callsMXC_GPIO_Config()for the SPI pins, even when
MSDK_NO_GPIO_CLK_INITis defined. Zephyr definesthis for all builds and configures pins through pinctrl, so every
spi_configure()call overwrote the pinctrl settings (alternate function,pull-up, VDDIOH, drive strength). On the MAX78002 EV kit this also affected
P0.10/P0.11 (I2C0 SCL/SDA), because they are SPI0 SS2/SS1 pins.
Two changes:
spi_ai87.c: skip the GPIO configuration whenMSDK_NO_GPIO_CLK_INITis defined, as
spi_me17.calready does.wrap_max32_spi.h(Zephyr wrapper): zero-initialize the unusedmxc_spi_pins_tpassed toMXC_SPI_Init(). It was uninitialized, so pinselection depended on stack contents.
Testing
Tested on MAX78002EVKIT on the ADI Zephyr hardware farm with a new test,
tests/drivers/spi/spi_max32_pinctrl. It checks P0.4-P0.11 GPIO registersafter a direct
MXC_SPI_Init()call and after an SPI transfer through theZephyr driver.
MXC_SPI_Init()changes EN0 (0x300 -> 0x0) and an SPItransfer changes PADCTRL0 (0xcf0 -> 0x4e0).
SPI tests on MAX78002EVKIT also pass (spi.loopback, max32_dma.loopback,
max32_rtio_dma.loopback, dt_spec).
Checklist Before Requesting Review
Signed-off-by: Dimitrije Lilic <Dimitrije.Lilic@analog.com>