cancel
Showing results for 
Search instead for 
Did you mean: 

How to properly initialize LwIP for static IP or DHCP?

ARaid.1
Associate III

For example, my EEPROM has setting for static IP or DHCP.

The problems is MX_LWIP_Init() does not have proper user code sections. It always call dhcp_start(), but I do not need it in case of static IP. The other problem is no any static IP config and all my changes lost each time I regenerate code. Maybe i'm missing something?

1 REPLY 1
Imen.D
ST Employee

Hello @ARaid.1​ ,

You can start with LwIP application under STM32CubeXX MCU package with a similar type of your project to deduce what is going wrong in your case. 

Check the post How to make Ethernet and lwIP working on STM32, and the example in this article "How to create project for STM32H7 with Ethernet and LwIP stack working" it may help you.

> all my changes lost each time I regenerate code. 

In CubeMx, make sure to enable the option: Keep user code when regenerating the C code. 

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen