ExampleEthernet is the minimal Ethernet bring-up loop.
It validates:
- board Ethernet pinset selection
- PHY selection (
LAN8742,LAN8700, orKSZ8041) - MAC + IPv4 initialization
- continuous
eth_instance.update()polling in the main loop - basic board liveness through the status LED
Nucleo + on-board LAN8742:
./hyper build ethernet --preset nucleo-debug-eth --test 0Custom board with KSZ8041:
./hyper build ethernet --preset board-debug-eth-ksz8041 --test 0Equivalent macro selection:
EXAMPLE_ETHERNETTEST_0
This example uses a fixed board IP:
- Board IP:
192.168.1.7 - Netmask:
255.255.0.0 - MAC:
00:80:e1:00:01:07
- The LED on
PB0is turned on and stays on. - If Ethernet support is enabled (
STLIB_ETH), the example continuously callseth_instance.update(). - There is no socket traffic in this example.
- Connect the board Ethernet port to the host.
- Put the host NIC on the same subnet.
- Flash and reset the board.
- Ping the board:
ping 192.168.1.7- The board responds to ping.
- The LED remains on.
- There should be no hard fault on boot.
- TCP socket creation
- UDP socket creation
- packet parsing
- reconnection logic
Use ExampleTCPIP or ExamplePackets for that.
- No ping and no link LEDs: PHY, cable, host NIC config, or wrong preset.
- LED on but no ping: MAC/PHY init issue, wrong subnet, or host routing problem.
- Build fails: wrong Ethernet preset for the board/PHY combination.