STM32F779 Ethernet LwIP DHCP not working
Hi,
I am currently working with STM32F779 and i'm trying to obtain an IP address using the LwIP Middleware unsuccessfully.
Here are the configurations:
1. Change some jumpers according to the user manual page 23.

2. Using the STM32CubeMX, i've made the following configurations

3. In the header file lwip.h i have extern the following variables (used in lwip.c file) because they will also be used at freertos.c file :
extern struct netif gnetif;
extern ip4_addr_t ipaddr; extern ip4_addr_t netmask; extern ip4_addr_t gw;4. In the source file
freertos.c
, inside the defaultThread, i have the following:MX_LWIP_Init();
while (gnetif.ip_addr.addr == 0)
{
sys_msleep(DHCP_FINE_TIMER_MSECS);
dhcp_fine_tmr();
mscnt += DHCP_FINE_TIMER_MSECS;
if (mscnt >= DHCP_COARSE_TIMER_SECS * 1000)
{
dhcp_coarse_tmr();
mscnt = 0;
}
BSP_LCD_DisplayStringAtLine(20,''DHCP Negotiating'');
}
Unfotunately, the
gnetif.ip_addr.addr
is not changing as it should be after obtaining an IP address.Is there something that i am missing?
Please help me to find the right solution.
Kind regards,
Ioannis
#stm32f779-cubemx-hal #dhcp #lwip