cancel
Showing results for 
Search instead for 
Did you mean: 

unable to ping Ethernet with STM32F207 board , LAN8742A and LWIP

joseph787
Associate II

I'm trying to build a server using STM32F207 processor and LAN8742A I have used CubeIDE to generate the configuration code and modified as follows:

1) ETH -> Auto negotiation Enabled

            -> PHY Address = 0

            -> PHY SR Offset = 1F

            -> PHY Speed Mask = 0x0004

             -> PHY Duplex Mask = 0x0010

             -> PHY Interrupt Source Flag register Offset = 0x001D

             -> PHY Link Down Interrupt = 0x0010

Rest of the settings are default. Since I found these to be wrongly auto generated.

2) LWIP ->  LWIP_DHCP = Disabled

               -> IP Address = 192.168.001.111

               -> Netmask Address = 255.255.255.000

               -> Gateway Address = 192.168.001.001

3) LWIP -> Key Options -> MEM_SIZE (Heap Memory Size) = 10*1024 Bytes

Then generated the code and added the below  

int main(void)
{
   HAL_Init();
  SystemClock_Config();

  MX_GPIO_Init();
  MX_LWIP_Init();

  while (1)a
  {
  MX_LWIP_Process();
  }
}

But unable to ping the above IP address from my command prompt. when I check "Ipconfig" on the command prompt, it shows this  
Autoconfiguration IPv4 Address. . : 169.254.89.23
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
I have cross verified it shows the above only when I connect LAN cable to my board. But doesn't show my IP Address which I configured.

The Processor is able to communicate with PHY , I could check on my Oscilloscope, the data sent is correct via MDIO and MDC. If I can establish this ping, then I have to create a TCP Server using my board to transfer sensor data to pc and receive command from PC.

 Please Help me through , what am I doing wrong or if there are any bugs in the STM32 libraries etc.

1 REPLY 1
STea
ST Employee

Hello @joseph787 ,

are you using a costume board or this is the nucleo board ?

i think you shoud check the PHY and try to make sure it is configured correctly maybe try to get the status of the LAN8742_Init() function .

or try reading the device address from special mode register .

i recommend you debug in step by set inside the LAN8742_Init() to make sure you have the right configuration set .

BR 

 

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.