← Back to Pull requests

fix(PeriphDrivers): Skip GPIO init in MAX78002 SPI when MSDK_NO_GPIO_CLK_INIT is defined #1651

Closed
unknown closed this pull request without merging on Nov 23, 2026 11:16 UTC
View on GitHub
unknown unknown commented on Nov 19, 2026 17:17 UTC
Author

Description

On MAX78002, MXC_SPI_Init() in spi_ai87.c always calls MXC_GPIO_Config()
for the SPI pins, even when MSDK_NO_GPIO_CLK_INIT is defined. Zephyr defines
this 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 when MSDK_NO_GPIO_CLK_INIT

  • is defined, as spi_me17.c already does.
  • wrap_max32_spi.h (Zephyr wrapper): zero-initialize the unused

  • mxc_spi_pins_t passed to MXC_SPI_Init(). It was uninitialized, so pin
    selection 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 registers
    after a direct MXC_SPI_Init() call and after an SPI transfer through the
    Zephyr driver.

  • Without the fix: MXC_SPI_Init() changes EN0 (0x300 -> 0x0) and an SPI

  • transfer changes PADCTRL0 (0xcf0 -> 0x4e0).

  • With the fix: all tests pass and the pin configuration is unchanged. The existing

  • SPI tests on MAX78002EVKIT also pass (spi.loopback, max32_dma.loopback,
    max32_rtio_dma.loopback, dt_spec).

    Checklist Before Requesting Review

  • PR Title follows correct guidelines.

  • Description of changes and all other relevant information.

  • (Optional) Link any related GitHub issues using a keyword

  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.
  • Signed-off-by: Dimitrije Lilic <Dimitrije.Lilic@analog.com>

    Diff: 219 lines (+164 / -55) across 2 files Reviewer: ttmut Review duration: 5398m
    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
    0.37
    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.323
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1651"
    general weight: 0.35
    Reviewers
    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: 36.7% (MEDIUM) · Higher = larger blast radius
    36.7%
    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: 14.5% · Safe to merge
    14.5%