LAN8742A Link status delay
I'm working on a custom PCB with a STM32F429ZIET6 MCU interfacing with a LAN8742A ethernet PHY. We only use static IP, and UDP communication. Our design has 28 devices all set to unique IPs on the network, which will be controlled over a proprietary protocol using UDP. The issue is that ethernet sometimes takes up to 15 minutes to start communicating. In some setups, the issue seems to be more reliable. For example setting a device up on a switch that only has a PC connected to it for communication, seems to be the best success rate. If we setup the same device on a router running DHCP, the issue becomes much more regular, probably 80%+ of the time the device will take 3.5 - 15 minutes to begin communication.
What I've observed in software is that the link status comes "up" on boot within the first 5 seconds of boot, and most of the time instantly. If this happens, communication is successful. We're currently setting up a test to run a device for 5 hours and verify that once the link status is "up" and the device is communicating over ethernet, it does not lose ethernet communication later.
I'm using STM32CubeIDE running FreeRTOS 10.3.1 CMSIS v1 and using the LWIP library and LAN8742 driver / BSP_COMPONENT_DRIVER. The only modification to ethernet setup is the pins used for communication.
When I read the BSR from LAN8742A I can see that the value of the register is either decimal 30765 (0b111100000101101) or decimal 30729 (0b111100000001001) on boot. Within the first 5 seconds the register will either change to 30765 and ethernet communication will be successful, or will remain 30729 for up to 15 minutes, and then change to 30765 indicating "link is up" and ethernet communication will be successful.
I'm running tests to confirm that FreeRTOS is not throttling the ethernet initialize process in any way. Any insight into what is required for link status to be "up" is greatly appreciated. We're combing the datasheet in search of anything we can use.
Note: Test setup between "successful" and "unsuccessful" ethernet communication within 5 seconds of booting the device is not changing. We see worse results with a router running DHCP, than results run with only a switch, but we can get failures either way.
See attached schematic for ethernet PHY.

