|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
Layer: Foundation ยท Build flags: PC_ENABLE_ETHERNET, PC_ETH_W5500, PC_ETH_W5500_*
The RMII path (Ethernet) needs a chip with an on-chip Ethernet MAC. The ESP32-S3 has no RMII MAC, so a wired link there uses an SPI Ethernet controller - the WIZnet W5500 - over the HSPI bus. With PC_ETH_W5500=1, init_eth_physical() calls the arduino-esp32 3.x ETH SPI API (ETH.begin(ETH_PHY_W5500, ...)); once the link has a DHCP IP the server accepts on it with no other change:
Nothing else changes: the egress reporting already classifies the wired route as pc_iface::PC_IFACE_ETH, so pc_net_egress(), per-route STA/AP/ETH interface filters, and every protocol work over the link the moment it has an IP.
The pins come from the PC_ETH_W5500_* build flags in build_opt.h:
| Signal | GPIO | Flag |
|---|---|---|
CS | 7 | PC_ETH_W5500_CS |
RST | 6 | PC_ETH_W5500_RST |
INT | 5 | PC_ETH_W5500_INT |
SCLK | 12 | PC_ETH_W5500_SCK |
MOSI | 11 | PC_ETH_W5500_MOSI |
MISO | 13 | PC_ETH_W5500_MISO |
Plus VCC 3V3 and GND. Set the flags for your own wiring; see the hardware hookup guide for the full pinout.
PC_ETH_W5500_SPI_MHZ sets the SPI clock (default 20). Throughput is SPI-bound, not PHY-bound: measured on an ESP32-S3 it is ~7.2 Mbit/s at 20 MHz and ~8.2 Mbit/s at 24 MHz, plateauing near the W5500's internal ~8.3 Mbit/s ceiling around 30 MHz. Higher clocks need clean, short wiring - on breadboard jumpers, sustained transfers stay reliable to ~24 MHz and the SPI reads corrupt above ~33 MHz. Keep the default unless the W5500 is on a short, clean PCB trace. A 200 MB download completes byte-exact at the 20 MHz default. For near-100-Mbit speed use an RMII PHY (LAN8720, Ethernet) - the W5500 trades speed for needing no built-in MAC. See FEATURE_PERFORMANCE.md for the full clock-vs-throughput sweep.
W5500 SPI Ethernet is arduino-esp32 3.x only - the 2.x ETH library has no W5500 support (ETH_PHY_W5500 is undefined there). Build this with the arduino-cli / IDF-5.x core.
The flags must reach the library build, so pass them as build flags:
(The Arduino IDE reads the flags from build_opt.h beside the sketch automatically.)