Skip to content

[stm32n6, stm32h5, eth] Change eth driver to allow the MDIO clock div to be configurable#46

Merged
AlexLanzano merged 1 commit into
wolfSSL:mainfrom
AlexLanzano:stm32-eth-fix
Jun 4, 2026
Merged

[stm32n6, stm32h5, eth] Change eth driver to allow the MDIO clock div to be configurable#46
AlexLanzano merged 1 commit into
wolfSSL:mainfrom
AlexLanzano:stm32-eth-fix

Conversation

@AlexLanzano
Copy link
Copy Markdown
Member

No description provided.

@AlexLanzano AlexLanzano self-assigned this Jun 4, 2026
Copilot AI review requested due to automatic review settings June 4, 2026 22:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the STM32H5 and STM32N6 Ethernet MDIO clock divider configurable by moving the MACMDIOAR CR selection from a driver-side constant into the per-board Ethernet configuration struct, so boards can select the correct divider for their HCLK.

Changes:

  • Add mdioCr to whal_Stm32h5_Eth_Cfg and whal_Stm32n6_Eth_Cfg to carry the MACMDIOAR CR field value.
  • Update STM32H5/STM32N6 MDIO read/write paths to use cfg->mdioCr instead of a hard-coded ETH_MDIO_CR.
  • Update the STM32H563ZI Nucleo and STM32N657A0 Nucleo board ETH device initializers to set mdioCr appropriately for their HCLK.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
wolfHAL/eth/stm32n6_eth.h Adds mdioCr to the STM32N6 ETH config struct (documented mapping for CR values).
wolfHAL/eth/stm32h5_eth.h Adds mdioCr to the STM32H5 ETH config struct (documented mapping for CR values).
src/eth/stm32n6_eth.c Uses cfg->mdioCr when programming MACMDIOAR for MDIO reads/writes.
src/eth/stm32h5_eth.c Uses cfg->mdioCr when programming MACMDIOAR for MDIO reads/writes.
boards/stm32n657a0_nucleo/board.h Sets .mdioCr in the STM32N6 ETH device config initializer.
boards/stm32h563zi_nucleo/board.h Sets .mdioCr in the STM32H5 ETH device config initializer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wolfHAL/eth/stm32n6_eth.h
@AlexLanzano AlexLanzano merged commit 58f626b into wolfSSL:main Jun 4, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants