KSZ8081 PHY initialization error
I'm currently trying to get the TCP/IP stack working on a PIC32 MCU. It's on a custom board.
I made a new Harmony 3 project and configured the TCP/IP stack.
MCU: PIC32MX675F512H (QFN package)
PHY chip: KSZ8081MLX
In the attachments I included a ZIP with inside the .xml harmony configuration file, you can find all the settings in there if you open it.
So the code generates fine and I uploaded it to the MCU. When looking at the debug message over UART1 I get the following messages:TCP/IP Stack: Initialization Started DRV PHY init failed: -1 TCP/IP Stack: Initialization failed: 0x0 - Aborting! APP: TCP/IP stack initialization failed!
So the DRV PHY init failed: -1 error code points to the following error description:
"No PHY was detected or it failed to respond to reset command"
So the problem of course is that the KSZ8081 chip does not respond or is not connected properly.
However, i'm having a hard time figuring out the cause is hardware or software.
in the image below you will find the schematic part of the connections between the PIC32 and KSZ8081. In this schematic the MCU name is wrong, but the connections are the same.
I traced the code to the point where the error is thrown. It occurs in drv_ethphy.c (included in the attachments)
inside the function _DRV_ETHPHY_SetupPhaseDetect
at 2 different locations.
This function gets called multiple times and includes some state machine. The error is thrown in either state machine case 3 (line 908) or 5 (line 926)
Which one it is depends on my setting of the PHY address (TCPIP_INTMAC_PHY_ADDRESS
If i set the address to 0 or 1, the error is thrown in case 3
If the address is between 2 and 7 the error is thrown at case 5.
If someone sees what i'm doing wrong here, please help me.
In the meantime I will continue working on this issue and will post a solution if I find one.
post edited by Jesse@Blue - 2020/02/28 06:53:39