Ethernet switch in STM32P257 DK BOARD
- September 28, 2026
- 1 reply
- 16 views
Hi all,
I am bringing up the Ethernet switch (ETHSW) on an STM32MP257F-DK, bare-metal on the Cortex-A35 (no OS), following RM0457 Rev 5.
Ping works with the switch bypassed (ETH1 directly to the PHY), and ping also works under Linux with the switch enabled on the same board. In bare-metal switch mode, ARP works but ICMP never arrives.
SETUP
- ETH1 -> Port0 (internal, no PHY), PHY (RTL8211F, RGMII) on Port2, negotiated 100 Mbps full duplex
- SYSCFG_ETHSWCR = 0x6
SYSCFG_ETH1CR = 0x12
- Init order:
ETHSW reset -> clocks -> SYSCFG_ETHSWCR -> release reset -> pulse ETHSW_FES_GEN_CTRLR INIT_REQ (bit 15) -> then ETH1 clocks/reset/DMA
- PORT0 UNDER MANAGEMENT,MII,100 MBPS
- PORT2 UNDER NORMAL, MII,100 MPBS
WHAT WORKS
- Broadcast/multicast from the PC reach ETH1 (ETH1 MMC broadcast counter increments)
- The board's ARP reply (unicast) leaves ETH1, crosses Port0 -> Port2 (Port0 RX_UNICAST=1, Port2 TX_UNICAST=1) [confirm in Wireshark that the PC actually receives it]
- Dynamic MAC table shows the PC MAC on port 2 and the board MAC on port 0
- VLAN table via ETHSW_FES_VLAN_CMDR: VLAN 0x000, 0x001, 0xFFF all have members = 0x7, tagging not disabled; FESx_VLAN0R = 0x8FFF on all ports
WHAT FAILS
- Port2 RX_UNICAST stays at 0 while RX_BROADCAST/RX_MULTICAST increment
- No ICMP echo request ever reaches ETH1 (unicast counter in ETH1 MMC = 0)
- The PC keeps sending ARP requests [confirm with "arp -a" / Wireshark]
- FES drop counters (FULL_DROP, Q_DROP, RX_POLICED, EARLY_DROP, RX_CRC_ERROR) all read 0
question
- When the FES ports are configured in
HW_MODE_GMII, the FES RX/TX counter values do not increment even though Ethernet traffic is present and the PHY link is up. Why is this happening? Is there any additional clock, interface, or FES register configuration required for the counters to operate correctly in GMII mode? - When the FES ports are configured in
HW_MODE_MII, the FES RX/TX counters increment correctly, but unicast ICMP/ping traffic does not reach ETH1/CPU. Broadcast and multicast traffic are received successfully. What additional FES configuration is required for unicast forwarding in MII mode?
