cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet is not detecting after assigning the Static IP

PG.9
Associate III

Greetings !

I am using Azure RTOS on STM32H743 and I tried setting up the Static IP for Ethernet. I could successfully able to assign Static IP .

Here after this I am observing that , most of the times IP address is assigning only when I remove and re-insert the Network Cable .

Can you please help me out to overcome this issue . Below mentioned is my "App_Link_Thread_Entry" function .

Thanks in Advance

-----------------------------------------------------------------------------------------------------------

/* @brief Link thread entry

* @param thread_input: ULONG thread parameter

* @retval none

*/

static VOID App_Link_Thread_Entry(ULONG thread_input)

{

 ULONG actual_status;

 UINT linkdown = 0, status;

 while(1)

 {

  /* Get Physical Link stackavailtus. */

  status = nx_ip_interface_status_check(&IpInstance, 0, NX_IP_LINK_ENABLED, &actual_status, 10);

  if(status == NX_SUCCESS)

  {

   if(linkdown == 1)

   {

    linkdown = 0;

    status = nx_ip_interface_status_check(&IpInstance, 0, NX_IP_ADDRESS_RESOLVED,

                   &actual_status, 10);

    if(status == NX_SUCCESS)

    {

     /* The network cable is connected again. */

     printf("The network cable is connected again.\n\r");

     /* Print UDP Echo Client is available again. */

     printf("Webserver Application is available again.\n\r");

//#if 0

     // WWDebug: try this:

 /* Send command to Enable Nx driver. */

     printf("\r\n WWDebug : Try to re-enable link\n\r");

 nx_ip_driver_direct_command(&IpInstance, NX_LINK_ENABLE, &actual_status);

 tx_semaphore_put(&Semaphore);

//#endif

    }

    else

    {

     /* The network cable is connected. */

     printf("The network cable is connected.\n\r");

     /* Send command to Enable Nx driver. */

     nx_ip_driver_direct_command(&IpInstance, NX_LINK_ENABLE, &actual_status);

     tx_semaphore_put(&Semaphore);

    }

   }

  }

  else

  {

   if(0 == linkdown)

   {

    linkdown = 1;

    /* The network cable is not connected. */

    printf("The network cable is not connected.\n\r");

   }

  }

  tx_thread_sleep(60);

 }

}

/* USER CODE END 1 */

-----------------------------------------------------------------------------------------------------------

2 REPLIES 2
Imen.D
ST Employee

Hello @PG.9​ ,

Please have a look at this article: How to create project for STM32H7 with Ethernet and LwIP stack working.

Make sure to disable DHCP server.

You can check the available application within STM32CubeH7 MCU package.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
MSG_ST
ST Employee

Hi @PG.9​ ,

In order to understand well your issue, could you please clarify some points :

  • when you say "you are able to assign Static IP", you mean that your IP instance address is affected than go to 0 ?
  • Your IP instance address is affected only when you unplug and plug the cable ?
  • Without unplug and plug the cable, are you able to ping the board ?
  • Is your issue present even with default App_Link_Thread_Entry without any modification ?

Regards

Mahdy