Configuring an Ethernet PHY (Davicom DM9161A)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Configuring an Ethernet PHY (Davicom DM9161A)

跳至解决方案
2,871 次查看
panpwr
Contributor IV

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.

标签 (1)
0 项奖励
回复
1 解答
1,533 次查看
panpwr
Contributor IV

We've tried to do so, but it didn't quite help... We've added an external pull up and it all seems stable now.

Thank you ! :smileyhappy:

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,533 次查看
panpwr
Contributor IV

OK, found some problems HW-related problems (following this post: Re: MCF52259 &amp; 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.

1,533 次查看
c0170
Senior Contributor III

Hello,

I have noticed just this one recently, to configure internall pull up, there's lwgpio_set_attribute function.

Regards,

MartinK

1,534 次查看
panpwr
Contributor IV

We've tried to do so, but it didn't quite help... We've added an external pull up and it all seems stable now.

Thank you ! :smileyhappy:

0 项奖励
回复