netInitialize strange behavior without osDelay before

Hello,

I am currently facing some strange behaviors of a FW and I think that some of these behaviors are linked to the Network initialization (netInitialize function).

Indeed, with an osDelay of 100ms before calling netInilialize (within the app_main thread), the FW executes correctly (successful communication with a UART device). However, if I remove the osDelay function, the FW does not execute correctly anymore (errors in the communication with the UART device). To summarize, as soon as I remove the delay before netInitialize, it impacts the behavior of the FW (even parts not related to Network).

In both cases, the status of the function netInitialize is "netOK".

I have seen in another post someone having to add this delay of 100ms before initializing the Network layer. I haven't found any statement yet about the reason of adding this delay (which makes no sense to me).

Do you have any idea about the reason why this delay is necessary? If needed, what must be its minimum value? Is there anything that could cause a "change" in FW behavior due to netInitialize?

Here is my setup:

  • Target device: STM32F407ZGT6
  • Keil Network IPv4 Release V7.11.0
  • Keil RTX5 V5.5.1

Thank you in advance.

  • You did not specify the interface you are using, I assume this is PPP on USART.

    Network library initialization is generally not dependent on delays, but the netInitialize () function also initializes drivers. This could have some impact. The USART interface may not be ready after power-up and needs an initial delay before initializing usart.

    Some PHY drivers, for example, require a start delay when the hardware design includes a resistor-capacitor power-on reset circuit. The PHY is then held for 200-500 ms in reset. In such cases, netInitialize must also be delayed to properly initialize PHY.

More questions in this forum