AnsweredAssumed Answered

Problem with LAN8720

Question asked by arnogir on Apr 15, 2016
Latest reply on Jun 12, 2016 by arnogir

Hello,

 

I'm using the K70 150MHz with an Ethernet PHY Lan8720.

I'm using MQX 4.1.1.

I'm using KDS 3.0.0 with a debbuger P&E Multilink Universal.

 

When I start my software with KDS and P&E debbuger, all Ethernet communication is Ok.

If the board start without debbuger, Ethernet communication not work (I power Off/On with or without JTAG of P&E multilink linked on the board)

 

I explain :

I have a phy driver which make the following on "Phy_lan8720_init": ( It is same than the provided KSZ8041 driver)

- Get status Register (0x01) and make a infinite loop (With a protection timeout) until status "Auto négociation complete" (bit 5 of status register 1 in my case)

Then after, thank to my code, I'am poll periodically the status to detect link status (Function xxx_get_link_status via IPCFG interface)

 

1) When I'm using the debbuger (Power is ON since long time...) I have the following:

- In phy_lan8720_init just when enter in the function, display CR and SR:

  a) Control Register 0 value is 0x3100 => Auto-Negotiation Enable : = 1 (Bit 13 and 8 is set to 1 but not usable because bit 12 Auto-Negotiation is 1)

  b) Status register 1 Value is 0x782D : Auto-Negotiate complete, Link status is Up.

 

Then after, when link status is get, link is Up and all is Ok. If I get status I have 782D, If I get register 31 I get 0x1058...

 

2) When I'm Power Off/On (Kds is linked OFF, debbuger is kept linked) I have the following:

- In phy_lan8720_init just when enter in function, display CR and SR:

  a) Control Register 0 value is 0x3000 => Auto-Negotiation Enable : = 1 (Bit 13 is set to 1 but not enable because bit 12 Auto-Negotiation is 1, bit 8 is clear..)

  b) Status register 1 Value is 0x7809 : Auto-Negotiate NOT complete, Link status is Down.

 

Then the loop expire because Auto Negotiate never end before timeout..

Then after, when link status is get, link is down and no connection work. If I get status I have 7809, If I get register 31 I get 0x40!!!!

 

Whatever Ethernet cable is connected/disconnected, reconnected...To resume, I have exactly this behavior if i'M in the first case (With debbuger) but Ethernet Cable not linked....

 

Same behavior if debbuger is unplug (Board is alone..)

 

Maybe the Lan8720 is noise on power ON?

I try on init function to apply a software Reset (CR = 0x8000) and then set CR to 0x3000 or 31000, but this still work with debbuger and not working without him..

 

Have you some idea????

 

Outcomes