cancel
Showing results for 
Search instead for 
Did you mean: 

LwIP corrupts memory - How to configure Ethernet and LwIP Addresses correctly?

Sandro_K
Associate III

Hello,
I use a STM32F777 with FreeRTOS and LwIP. I also run a display control with TouchGFX and partial framebuffer via SPI. I have configured the Ethernet and LwIP as shown in the following link: https://community.st.com/t5/stm32-mcus/implementing-a-lwip-and-freertos-v1-udp-echo-server-on-the/ta-p/780261 .

The Ethernet works so far after booting. However, there are always artifacts on the display, as LwIP seems to write to the areas of the frame buffer.

However, I have created the Linkerscript configuration as in the tutorial from the link and also added a LwIP heap section. Unfortunately it still does not work stable.
What do I have to adjust so that it works without errors?

Here is my configuration:

lwip_settings_1.png

lwip_settings_2.png

eth_settings.png

mpu_settings.png

3 REPLIES 3
STackPointer64
ST Employee

Hello @Sandro_K,

Based on your description, I recommend the following approach to help isolate and resolve the issue:

Start by testing the Display Control and framebuffer functionality without enabling Ethernet. This will help determine if the artifacts are related to the display or framebuffer itself, independent of the Ethernet and LwIP operations. If the display works correctly without Ethernet, it suggests that the problem arises when Ethernet is active.

In that case, please try to reproduce the problem, and if possible, provide a minimal example of your project illustrating this issue. This will help in diagnosing whether there is a memory overlap, improper synchronization, or other conflicts between Ethernet/LwIP and the framebuffer. If the project is private, feel free to send it to me privately.

Best regards,

 

To improve visibility of answered topics, please click Accept as Solution on the reply that resolved your issue or answered your question.

Hello STackPointer64,

thanks for your reply.

The display control works without any problems. If the Ethernet cable is not plugged in, the application runs for hours without any problems.
I have a web server on the STM that cyclically reloads website content via GET requests every 500ms. This of course generates traffic. The problem only occurs when the website is connected to the STM and the data is reloaded cyclic.

I will prepare a minimal configuration of the project and make it available here.

Hello,
here I provide the entire project. As already described, the framebuffer is overwritten, which is also shown by the artifacts in the display. At some point TouchGFX hangs up completely. If the web server task is deactivated, it works without any problems.
The LwIP debug output is also output via UART 8.
I would be pleased to receive tips on how to solve the problem.