AnsweredAssumed Answered

STM32F779 Ethernet LwIP DHCP not working

Question asked by Io D on Feb 23, 2017
Latest reply on Mar 15, 2017 by Imen D

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.

 

http://www.st.com/content/ccc/resource/technical/document/user_manual/group0/64/5f/b4/25/72/a8/44/d9/DM00276570/files/DM00276570.pdf/jcr:content/translations/en.DM00276570.pdf

 

STM32F779 - Change jumpers

 

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

Attachments

Outcomes