Adding more info:
I have performed more tests using 5 different boards (3 have worked fine and 2 have presented the issue) and I notice that the label in the W7500P component is almost erased in the ones with the issue.
We have switched the W7500P of 2 boards (One with the issue and one working fine) and the issue changed from one board to the other, which means the problem is in the W7500P and not in the boards.
I really need assistance from Wiznet! Can you please assist me?
I noticed it is an intermittent problem in some W7500P units. Can you please detail what are the W7500 pins that are connected to the phy and how we should set their pad control registers?
I have been able to find the issue and to solve it.
For those facing the same issue: LED1 and LED2 of the W7500P phy are floating when the MCU is turned on, which means they can assume any value and they are responsible for defining the PHY address. Based on that, it is necessary to test the odd phy addresses between 1 and 7 every time you start the MCU.
Notice that, some examples from Wiznet does solve this issue inside the function phy_id (I believe a separate function would be more adequate), but the mbed libraries from Wiznet (WIZnetInterface or WIZnetInterface-OS5) does not implement the correction.