Skip to content

arch/arm/stm32h5: Use MDIO bus - #20121

Merged
xiaoxiang781216 merged 3 commits into
apache:masterfrom
darrylring:feature/stm32h5-mdio
Sep 14, 2026
Merged

xiaoxiang781216 merged 3 commits into
apache:masterfrom
darrylring:feature/stm32h5-mdio

Conversation

@darrylring

Copy link
Copy Markdown
Contributor

Summary

Copy the MDIO bus changes from the STM32H7 port. This uses the same MDIO lower half driver as the STM32H7 and replaces the existing Ethernet PHY register read/write functionality.

Impact

There should be no user impact.

Testing

Built this configuration for the Nucleo H563ZI board: nucleo-h563zi-netnsh.patch

Ethernet comes up as expected, PHY communication works, receives IP via DHCP, etc.

ABCG
telnetd [5:100]

NuttShell (NSH) NuttX-13.0.1-RC1
nsh> ifconfig
eth0    Link encap:Ethernet HWaddr a2:60:64:cb:97:19 at RUNNING mtu 576
        inet addr:192.168.2.10 DRaddr:192.168.2.30 Mask:255.255.255.0
...
nsh> ping 192.168.2.30
PING 192.168.2.30 56 bytes of data
56 bytes from 192.168.2.30: icmp_seq=0 time=0.0 ms
56 bytes from 192.168.2.30: icmp_seq=1 time=0.0 ms
56 bytes from 192.168.2.30: icmp_seq=2 time=0.0 ms
56 bytes from 192.168.2.30: icmp_seq=3 time=0.0 ms
56 bytes from 192.168.2.30: icmp_seq=4 time=0.0 ms
56 bytes from 192.168.2.30: icmp_seq=5 time=0.0 ms
56 bytes from 192.168.2.30: icmp_seq=6 time=0.0 ms
56 bytes from 192.168.2.30: icmp_seq=7 time=0.0 ms
56 bytes from 192.168.2.30: icmp_seq=8 time=0.0 ms
56 bytes from 192.168.2.30: icmp_seq=9 time=0.0 ms
10 packets transmitted, 10 received, 0% packet loss, time 10110 ms
rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms
...
nsh> mdio 0
phy[0][0] = 0x1100
phy[0][1] = 0x782d
phy[0][2] = 0x   7
phy[0][3] = 0xc131
phy[0][4] = 0x 1e1
phy[0][5] = 0xcde1
phy[0][6] = 0x  6f
phy[0][7] = 0x2001
phy[0][8] = 0x4000
phy[0][9] = 0xffff
phy[0][10] = 0xffff
phy[0][11] = 0xffff
phy[0][12] = 0xffff
phy[0][13] = 0x   0
phy[0][14] = 0x   0
phy[0][15] = 0x   0
phy[0][16] = 0x  41
phy[0][17] = 0x   2
phy[0][18] = 0x60e0
phy[0][19] = 0xffff
phy[0][20] = 0x   0
phy[0][21] = 0x   0
phy[0][22] = 0x   0
phy[0][23] = 0x   0
phy[0][24] = 0x9b9d
phy[0][25] = 0x   0
phy[0][26] = 0x   0
phy[0][27] = 0x   a
phy[0][28] = 0x4000
phy[0][29] = 0x  c8
phy[0][30] = 0x   0
phy[0][31] = 0x1058

@github-actions github-actions Bot added Arch: arm Issues related to ARM (32-bit) architecture Size: L The size of the change in this PR is large labels Sep 11, 2026
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

arduino-mega2560

  • flash: .text +16 B (+0.0%, 65,128 B / 262,144 B, total: 25% used)

esp32-devkitc

  • ROM: .flash.text +12 B (+0.0%, 124,904 B / 4,194,272 B, total: 3% used)
  • irom0_0_seg: .flash.text +12 B (+0.0%, 89,108 B / 3,342,304 B, total: 3% used)

hifive1-revb

  • flash: .text -8 B (-0.0%, 83,724 B / 4,194,304 B, total: 2% used)

mirtoo

  • kseg0_progmem: .text +20 B (+0.0%, 67,772 B / 131,072 B, total: 52% used)

qemu-armv8a

  • Code: .text.nx_pthread_create -4 B, .text.nxsched_set_param +16 B, .text.spawn_execattrs +4 B, .text.work_qcancel +20 B (+0.0%, 336,944 B)

qemu-intel64

  • Code: .text +15 B (+0.0%, 8,659,813 B)

rx65n-rsk2mb

  • ROM: .text +16 B (+0.0%, 86,896 B / 2,097,152 B, total: 4% used)

s698pm-dkit

  • Code: .text +64 B (+0.0%, 367,552 B)

stm32-nucleo-f103rb

  • flash: .text +8 B (+0.0%, 34,556 B / 131,072 B, total: 26% used)

Copy the MDIO bus changes from the STM32H7 port.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Darryl Ring <darryl@bluerobotics.com>
Add an NSH config that also adds networking support and some basic
networking utilities.

Signed-off-by: Darryl Ring <darryl@bluerobotics.com>
acassis
acassis previously approved these changes Sep 12, 2026
Comment thread arch/arm/src/stm32h5/stm32_mdio.c Outdated
Comment thread arch/arm/src/stm32h5/stm32_mdio.c Outdated
Remove extra includes sections and quote include arm_internal.h.

Signed-off-by: Darryl Ring <darryl@bluerobotics.com>
@xiaoxiang781216
xiaoxiang781216 merged commit bc11615 into apache:master Sep 14, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Board: arm Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants