cancel
Showing results for 
Search instead for 
Did you mean: 

Help: bug in official ST nucleo LWIP Project

dieter 123
Associate III
Posted on November 13, 2017 at 10:41

Hi

basically I tried to set up LWIP and freertos on a F429ZI nucleo board. everything went fine, unless: I observed the following bug:

Bug description:

1. start FW with ethernet cable disconnected

2. wait for 10 secnds

3. plug ethernet cable

4. ping board

-> board wont reply to ping.

 I also went to ST's official example projects under.

STM32Cube_FW_F4_V1.17.0\Projects\STM32F429ZI-Nucleo\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS

In this code I had to diable DHCP, but then: same problem.

Any idea what to do ?

Thx

#lwip
15 REPLIES 15
Posted on November 14, 2017 at 18:49

If you believe that you can press a few buttons and get product ready code you are going to be very disappointed.

CubeMX spits out boilerplate code, it's only as good as the effort that went into creating it. From the forum traffic it should be evident that minimal review and regression testing has been done on this code.

Error propagation is pretty poor, error recovery is non-evident.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Oussema Hajjem_O
Associate III
Posted on November 15, 2017 at 18:01

Hello

dieter.dieter

,

This is not a bug, the auto-detection of the Ethernet cable is notimplemented for all boards,

In your case you need to reset the board after cable connection.

If you want you can send me your application and will implement this features for you

Best regards,

Oussema.

Posted on November 15, 2017 at 18:41

This is not a bug ,...

That would be debatable.

A real, paying customer would have specified and demanded such a thing ...

Luckily it is not difficult to implement.

Posted on November 16, 2017 at 08:42

Thanks @

HAJJEM.Oussema

>> the auto-detection of the Ethernet cable is notimplemented for all boards,

For which board is it implemented?

Posted on November 16, 2017 at 09:18

dieter 123 wrote:

>> the auto-detection of the Ethernet cable is notimplemented for all boards,

For which board is it implemented?

https://community.st.com/0D50X00009Xke7dSAB

Posted on November 16, 2017 at 11:05

Hi,

you can create a thread to poll for the link status with the following function:

void ethernetif_set_link(void const *argument)

{

  uint32_t regvalue = 0;

  struct netif *netif = ( struct netif *)argument;

  for(;;)

  {

    /* Read PHY_BSR*/

    HAL_ETH_ReadPHYRegister(&EthHandle, PHY_BSR, &regvalue);

    regvalue &= PHY_LINKED_STATUS;

    /* Check whether the netif link down and the PHY link is up */

    if(!netif_is_link_up(netif) && (regvalue))

    {

      netif_set_link_up(netif);

    }

    else if(netif_is_link_up(netif) && (!regvalue))

    {

      netif_set_link_down(netif);

    }

    /* Suspend thread for 200 ms */

    osDelay(200);

  }

}

BR,

Oussema.