Add generic wolfHAL Ethernet port with STM32H563ZI Nucleo board support#97
Add generic wolfHAL Ethernet port with STM32H563ZI Nucleo board support#97AlexLanzano wants to merge 1 commit intowolfSSL:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new src/port/wolfHAL/ port intended to let wolfIP run on any target that provides wolfHAL whal_Eth / whal_EthPhy, with STM32H563ZI Nucleo-144 as the first reference board and a standalone Makefile-based bare-metal build.
Changes:
- Introduces a generic wolfHAL-based link-layer adapter (
wolfhal_eth.c/.h) that bridges wolfIP ll_dev poll/send towhal_Eth_Recv/whal_Eth_Sendand starts the MAC after PHY negotiation. - Adds a generic bare-metal
main.cfor bringing up wolfIP, configuring a static IPv4 address, and starting a TCP echo server. - Adds a complete STM32H563ZI Nucleo board package (startup/IVT/linker/board init/syscalls + board.mk) and a port-local build system +
.gitignore.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/port/wolfHAL/wolfhal_eth.h | Public API/docs for the generic wolfHAL Ethernet bridge. |
| src/port/wolfHAL/wolfhal_eth.c | Implements wolfIP ll_dev poll/send via wolfHAL and link negotiation + MAC start. |
| src/port/wolfHAL/main.c | Bare-metal reference app wiring board init + wolfIP + echo server. |
| src/port/wolfHAL/Makefile | New Makefile entrypoint for BOARD-based builds. |
| src/port/wolfHAL/.gitignore | Ignores build artifacts. |
| src/port/wolfHAL/boards/stm32h563zi_nucleo/board.mk | Toolchain flags and board + wolfHAL driver source list. |
| src/port/wolfHAL/boards/stm32h563zi_nucleo/board.h | Board API and exported wolfHAL device instances. |
| src/port/wolfHAL/boards/stm32h563zi_nucleo/board.c | STM32H563ZI init: flash latency, clocks, GPIO, ETH/PHY, SysTick timer, UART. |
| src/port/wolfHAL/boards/stm32h563zi_nucleo/syscalls.c | Newlib stubs + wolfIP hooks (incl. RNG). |
| src/port/wolfHAL/boards/stm32h563zi_nucleo/startup.c | Minimal reset handler (data/bss init + libc init + main). |
| src/port/wolfHAL/boards/stm32h563zi_nucleo/ivt.c | Cortex-M33 vector table. |
| src/port/wolfHAL/boards/stm32h563zi_nucleo/linker.ld | Memory map and sections for STM32H563ZI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b5999a2 to
015ca06
Compare
015ca06 to
70ac819
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
70ac819 to
6e50685
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6e50685 to
fc3675e
Compare
fc3675e to
80a210f
Compare
9fbb31e to
878c293
Compare
dgarske
left a comment
There was a problem hiding this comment.
Can wolfHAL be less intrusive? Or show what an update of the existing STM32H5 wolfIP port look for the H5? Have you compare code size between the two (existing and this)? I'd almost like to see instead a proper update to a wolfHAL version of the drivers. Not src/port/wolfHAL but src/port/stm32h5 optionally using the wolfHAL to compare.
Summary
whal_Eth_Recv/whal_Eth_Send
Structure
src/port/wolfHAL/
├── Makefile, main.c, wolfhal_eth.c/h # Generic (board-independent)
└── boards/stm32h563zi_nucleo/ # Board-specific: clock, GPIO, ETH, UART, linker
Adding a new board requires only a
boards/<name>/directory with board.c/h, board.mk, and bare-metal startup files. The generic main.c and wolfhal_eth.c are shared across all boards.Build
Requires arm-none-eabi-gcc and wolfHAL cloned as a sibling directory (overridable via WOLFHAL_ROOT).
Testing
I tested this by doing a
ping 192.168.1.100on my host PC. I successfully got a responses back.