cancel
Showing results for 
Search instead for 
Did you mean: 

Connection through ethernet

Kuttay
Associate III

Hi, I am trying to create a connection through ethernet with lwip however I stuck at netif down I guess it related with flags which are checking the connection. I am using  STM32H735 board. lwip.c file codes are taken from the github (https://github.com/stm32-hotspot/STM32H7-LwIP-Examples/blob/main/STM32H735_Disco_ETH/LWIP/App/lwip.c) that is recommended in the forum for IDE 1.9. (FreeRTOS is being used.)

 

netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &tcpip_input);
while(1){
netif_set_default(&gnetif);

if (netif_is_link_up(&gnetif))
{ netif_set_up(&gnetif);
break;
}
else
{  netif_set_down(&gnetif);
}netif_set_link_callback(&gnetif, ethernet_link_status_updated);
}

 

 

5 REPLIES 5
SofLit
ST Employee

Hello and welcome to the community.

Please review the tips on how to post a thread on this community.

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

Thank you for your understanding.

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.

Sorry I was not aware of these standarts. I tried to edit my post according to the provided document.

Pavel A.
Evangelist III

@Kuttay   In your code snippet there's a while(1) loop.  Have you noticed that in the example this sequence runs only once, in the initialization?  Does your link status detection work?

 

I tried to make the system constantly check the link status so when the connection is set the system star yet. Without while(1) loop system starts with down link and I find my self stuck at private task error. But I will imediately check the statust detection. Thanks. 

Kuttay
Associate III

I checked the status detection but could not see any problem. I think problem could be related with tcp connection without setting the connection system continues to send tcp but stuck at receive uart while trying to send tcp since no connection is set.