Hello,
I am trying to use the MQX-supplied driver for my Ethernet PHY (assembled on my custom board), but I can't get it to work (MQX 3.8.0).
I've modified the following:
1. init_enet.c:
const ENET_IF_STRUCT ENET_0 = {
&MACNET_IF,
&phy_dm9161_IF, /*<=== instead of &phy_ksz8041_IF*/
MACNET_DEVICE_0,
MACNET_DEVICE_0,
BSP_ENET0_PHY_ADDR,
BSP_ENET0_PHY_MII_SPEED
};
2. init_enet.c:
#include "phy_dm9161.h" /*<=== instead #include "phy_ksz8041.h"*/
3. Recompiled BSP & RTCS libraries.
Now, the problem:
When performing phy_dm9161_init(), the Status Register reading (&phy_status) always returns 0x0, as if it has not been read at all (The PHY's status register default values are definitely different from 0x0).... So I thought checking K60 physical lines, to see if the request is transmitted at all:
When I check the MDIO I/O pin, I don't see anything that is transmitted to line. The MDC line shows accurate clocks at ~2.5MHz (as required by spec).
What am I doing wrong? I don't believe that it is a PHY configuration problem since no instruction is transmitted from K60 towards the PHy.
HELP! :smileyhappy:
Thank you.
已解决! 转到解答。
OK, found some problems HW-related problems (following this post: Re: MCF52259 & DP83640):
1. We've added a pull up resistor to the MDIO pin (though it was not mandatory according to the PHY's spec) - then we've started to see communication over the line. However, it was a bit noisy and inaccurate (when trying to make TCP communication).
2. We've added external trace, bypassing our custom's board traces - now it works well (probably due to a combination of problematic trace with a weak pull up) - Hurray! :smileyhappy:.
Now, for another related question:
How can I configure the internal pull up resistor for the MDIO line (PTB0) using MQX functionality? I am trying to save here the external pull-up.
Thanks!
Lior.