2025-06-25 11:01 PM - edited 2025-06-26 9:27 PM
Hi as part of my project I am trying to integrate the mentioned parts in subject to control modbus eth relay over tcpip.
What I have done so far.
1. Integrated Lan chip driver to stm32 library and initalization done.
2. Integrated LwIP stack from online resources and confirmed LwIP integration succeeded. (Since i'm using STM32H563RGT6 MCU and it doesnt have inbuilt LwIP stack with in it).
3. Initially tried to establish a connection with my PC and try a ping test.
4. I'm facing ARP Resolution initally but somehow it resolved and now i can find my MCU ip and mac address on my PC, but still ping is not reachable.
5. My POV is that if its capable of handling etherent packets then i can start work on with modbus packets to trigger the relay module.
Pls help me with this case...
Solved! Go to Solution.
2025-07-07 9:02 AM
Thanks for sharing your project details, @aravindpv. From my review, here are a few points to consider:
In app_freertos.c, the linker file is missing LwIP section configurations, and the stack size is set to 256 words × 4, which may be insufficient. Also, using LwIP polling functions (like ethernetif_input(...)
) inside the default task’s while loop is incorrect and won’t work. You should terminate the init thread with osThreadTerminate
instead.
In ethernetif.c, several essential functions are missing, including LwIP and callback functions that handle semaphores and other tasks. Additionally, the MAC address is commented out, so no MAC is assigned as the config struct used by LwIP.
The project also lacks an application layer such as a UDP server, which is necessary to ping the board and test connectivity.
To move forward, you have two options:
Compare your project with a working example that uses FreeRTOS. Note that the LwIP_TCP_ECHO_SERVER example does not implement FreeRTOS, so configurations differ between RTOS and non-RTOS setups.
I recommend starting from the LwIP_UDPTCP_Echo_Server_Netconn_RTOS project and adapting only chip-specific parts like GPIO configuration, ETH MSP init/deinit, clock setup, linker file (ensuring memory sections are respected), and LwIP configurations (memory size, stack size, etc.).
The choice is yours, and I will support you along the way until you have a working example.
2025-07-17 5:57 AM
Hi @STackPointer64 , I was busy with some other works for the last week.
As you suggested I used the LwIP_UDPTCP_Echo_Server_Netconn_RTOS and the integration was successful.
pls help me with this case..
2025-07-18 4:03 AM
@STackPointer64
please see the attached file.
I am not passin after netconn_accept. i have tried running a client from windows PC using telnet and it exits with timeout.
2025-07-22 4:57 AM
Hi the issue is resolved, established ping from pc to mcu
the issue is with implementation of lwipopts.h
2025-07-22 6:19 AM
Hello @aravindpv,
I’m glad to hear that you resolved your issue. I recommend adding the LwIP memory section in the linker file, as it was missing in your project. Also, consider sharing the specific issues you encountered in the lwipopts.h
file that caused your program to malfunction. This will help future users avoid the same mistakes. Thank you for your contribution.
Best regards,