I am currently using the NUCLEO144 STM32F746 board, as it had the RJ45 and PHY, but I've also attempted the same on a F769NI discovery with the same outcome and hoping to get some insight before I dig in too deep.
I am starting with a demo for this board (demos/STM32/RT-STM32F746ZG-NUCLEO144) and using the latest 21.11.3 release. I have then enabled the MAC subsystem and added lwip.mk and friends to my Makefile to get the associated pieces compiling. From looking at the forums, I have used the STM32F746xG_ETH.ld script, as well as disabled the DCache on this device for the time being (the latter seemed necessary). I can now initialize the LWiP stack with both a static IP and DHCP and it responds to ping.
If I initialize the pre-canned LWiP httpd server (with httpd_init() ), lo-and-behold I am served with a landing page on port 80. So that should ring out that my hardware is working.
However, I'm not interested in reading that implementation (yet), so I also noticed there are simpler demos such as demos/STM32/RT-STM32F107-OLIMEX_P107-LWIP which implement a _very_ basic web.c server thread which essentially:
- creates a socket
- binds to a port
- calls listen
- waits on accept()
- serves the live socket, and then closes it
I am attempting to get that running, but with little success. I can step in the debugger up to the point there the blocking call to accept starts waiting for a socket, but it never returns. Using a python client to connect to it, the connection seems to establish, but if I attempt to send any bytes to it I get "ConnectionResetError: [Errno 104] Connection reset by peer" from Python's implementation.
Any advice would be appreciated. I'm hoping I'm doing something stupid.
Also, if anyone with a board that has a MAC/PHY could double check these demos (especially the latter) that would be great too.