Skip to main content
Graduate
June 14, 2024
Question

Connection through ethernet

  • June 14, 2024
  • 3 replies
  • 1513 views

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);
}

 

 

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    June 14, 2024

    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.

    KuttayAuthor
    Graduate
    June 14, 2024

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

    Super User
    June 14, 2024

    @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?

     

    KuttayAuthor
    Graduate
    June 24, 2024

    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. 

    KuttayAuthor
    Graduate
    June 24, 2024

    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.