Ethernet PHY hardware interrupt

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

rubenswerk
Posts: 104
Joined: Wed Feb 22, 2012 11:39 am

Re: Ethernet PHY hardware interrupt

Post by rubenswerk »

The KSZ8031 has a strapping option for enabling auto negotiation.
The state of a pin is samples when reset pin is released. According to the data sheet, this pin has an internal pullup, leading to a activation of auto negotiation by default.

When I read the control register I can see that in some power cycles the auto negotiation bit is not set, leading to 10bmps mode.
I tried external pullup resistors, but the problem remains!

The MAC driver always does a read-modify-write when changing the control register. The only exception is when setting the reset bit all other bits are 0, but this should be ok. In all other cases, the auto negotiation bit (which should be there) is not cleared. I don't understand why the PHY does not activate auto negotiation sometimes...

A workaround for my problem is to manually configure 100mbps by setting the speed select bit in control register manually, right after waiting for the PHY reset to be finished in mac_lld.c

But I would prefer a clean solution. I tried to manually set the auto negotiation enable bit, and also the auto negotiation restart bit, but in that case, ethernet is dead. The link LED is on, but no ping reply.
Anybody who has experience with KSZ8031?
Thanks!
Post Reply