• AVR Freaks

Hot!KSZ8081 PHY initialization error

Author
Jesse@Blue
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2018/03/28 07:08:55
  • Location: Netherlands
  • Status: offline
2020/02/28 03:47:10 (permalink)
0

KSZ8081 PHY initialization error

Hello,
 
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. 
 
some details:
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

Attachment(s)

Attachments are not available: Download requirements not met
#1

2 Replies Related Threads

    Jesse@Blue
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2018/03/28 07:08:55
    • Location: Netherlands
    • Status: offline
    Re: KSZ8081 PHY initialization error 2020/02/28 03:49:03 (permalink)
    0
    So this website is bugging me that I have no rights to post... Below the promised schematic image. also found on this link: https://imgur.com/fFQ44fI
    #2
    eddy103
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2020/09/13 11:49:43
    • Location: 0
    • Status: offline
    Re: KSZ8081 PHY initialization error 2020/10/23 07:36:26 (permalink)
    0
    Hi Jesse!
    Did you find a solution? since I am also facing the same problem using KSZ8081MLX ?
    #3
    Jump to:
    © 2020 APG vNext Commercial Version 4.5