2026-01-19 7:47 AM
I have an STM32H563 running FreeRTOS and LwIP with the netcon interface.
For the most part its working OK, however when I send a lot of data (around 250KB/s for a few seconds) it crashes with a HARD_FAULT
It looks like the memory (pbufs) are being corrupted
The driver (etherentif.c) is based on LwIP/LwIP_HTTP_Server_Socket_RTOS/Src/ethernetif.c
taken from the STM32H7 cube
Is there an updated driver for the STM32H5 or one with known reliability ?
2026-01-19 7:53 AM
LwIP debug options:
Debugging Hard Faults in general:
2026-01-20 5:05 AM
You can try the alternative to LWIP - Mongoose. That's a TCP/IP stack with drivers, TLS 1.3, embedded web server, MQTT client, and remove firmware update - all in two files, https://github.com/cesanta/mongoose . Works under any RTOS or bare metal. The easy way to try it out on H563 is to visit https://mongoose.ws/wizard/#/output?board=h563&ide=CubeIDE&rtos=baremetal&file=README.md , select destination directory in the settings tab, click "generate" button at top right corner, and load the project in your Cube IDE. Attach serial console, flash, and you'll see the device IP address in the logs. Point your browser to that IP address, and then you can use modify the project any way you want.
2026-01-21 4:54 AM
Update:
The driver is far more stable with the following settings, although it is still not 100% (crashes after ~100MB now)
#define ETH_RX_BUFFER_SIZE 1600U
#define ETH_RX_BUFFER_CNT 12U
#define ETH_RX_DESC_CNT 4U
I increased ETH_RX_DESC_CNT previously to 12 which caused the problems - The comments in the file explain this.
ETH_RX_BUFFER_SIZE was set to 1000, but this is less than the max ethernet MTU which could be an issue (although no overrun errro should occur due to heth.Init.RxBuffLen being set)
2026-01-22 9:19 AM
Hello @pbayton9,
Could you please provide a minimal version of the project that reproduces the issue so I can investigate it? If the project is private, feel free to let me know, and I can provide a secure channel.
Best regards,
2026-01-24 7:48 AM
Many thanks for that. I will set up a sample project together with some application test software.
2026-02-03 6:11 AM
Hi
Please find attached test project:
EthDbg - main STM32 project. Main application code is under /Test
PFTest - windows program to test data
Press Connect, Connect2 (indicator should go green) , then the Acquire button
Notes:
All MAC address and IP are defined in get_dev_addr
Current settings are IP 192.168.1.34 etc.
The PHY is a LAN8720, similar to the LAN8742 from which the example was taken
There is no real MDIO communication with the Phy - it is hard coded to be assumed 100MB, full duplex
PC0 is the PHY reset pin - you may need to disable eth_rst_phy()
GPIOs may also be different - see HAL_ETH_MspInit