Hi,
We have been working through some problems we have seen with Ethernet startup when using FreeRTOS and lwip and have identified a couple of problems we'd like to report back for future fixes. I couldn't find anywhere official to post bug fixes so thought I would post here.
These have been found in enet_ethernetif.c found in middleware/lwip/port.
- In ethernetif_phy_init() if ENET_ATONEGOTIATION_TIMEOUT is set to zero we found that the PHY is never initialised. We don't think the same TIMEOUT config should be used for both the Init loop and the auto-neg loop.
- The speed and duplex variables may never be initialised but the caller then uses them to set the speed and duplex. So they are set to random values from the stack.
- And we noticed the tight loop during init with a suggested fix here - https://community.nxp.com/t5/MCUXpresso-SDK/MCU-stops-if-ethernet-cable-is-not-plugged-in-on-startup...
I hope this is enough info to give back to the dev team.
Thanks,
Martin