Hi Travis,
I tested MQX4.2 code and function ipcfg_get_link_active() at my FRDM-K64F board. It works correctly on my side.
Function ipcfg_get_link_active() returns false when I disconnect cable from board and returns true when I connect cable to the board. On opposite side of Ethernet cable was Ethernet switch.
For testing I used simply loop:
for (j = 0; j < 100 ; j++)
{
link = ipcfg_get_link_active(0);
printf("\n %d",link);
_time_delay (100);
}
It is true that ipcfg_get_link_active() function in MQX 4.2 was modified (we just added additional lower level function RTCS_if_get_link_status instead of direct calling ENET function), however this should not have any influence on result.
So, it is possible that you simply receiving random data from PHY – you can read data from PHY at MDC,MDIO pins by oscilloscope.
Please ensure that you set your Ethernet module to the same state as opposite side on Ethernet cable.
Default settings are 100Mbit, full duplex. If you use 10Mbit switch and your PHY is connected via RMII, you have to set this speed during Ethernet module initialization. 10Mbit speed cannot be set in ENET module by auto negotiation in case of RMII interface.
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------