Issue with SAM3X simple ethernet demo

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would have made this a tech support issue, and might if I am able to log in to myAtmel - right now it seems to be down (attempts to login immediately log me out), so I'll try my luck here and see if I am able to send to tech support later.

I have taken the sample code from the "Quickstart guide for the EMAC driver" and am trying to begin to get it up and running.  I have gotten it running to a point, but it is failing in auto-negotiation, and as far as I can tell it is not getting to the point of setting up a viable MAC connection.  I have yet to bring lwip into the project, but I have also tried running the third party basic LWIP demo, and am having the same problems there.

I know the communication with the PHY is working (using the same PHY as the SAM demo board, the Davicom DM9161A, and I know there is communication with it as attempts to read the ID work (in the function ethernet_phy_find_valid using address 0 the call to emac_phy_read(p_emac, uc_phy_addr, MII_PHYID1, &ul_value) != EMAC_OK) returns EMAC_OK and the value in ul_value is in fact 0x0181, which is the correct value for the DM9161A.  Attempts to try any other address from 1-31 correctly fails.  Actually, we tried forcing some of lines of PHYAD[0..4] high, but are still seeing communication with the PHY only on address 15.  

After the successful setup, ethernet_phy_auto_negotiate runs and times out.  It should, AFAIK, work (no gigabit issues here, cables are good, HW supports it all around).  After this, I see that the calls to emac_dev_read seem to always return empty.  Moreover, although I supposedly have a link setup, neither the LED on the PHY nor the one on the hub we are attached to shows anything.

My question - now that I know that I am talking with the PHY, how do I continue debugging - what should I be looking for?  I looked in the PHY datasheet to see if there was a way to force the LED on to see if I could just do that to test for proper installation, but there doesn't seem to be.  As far as I know, the layout for the board I'm working on  is copied from the datasheet SAM3X evaluation board, so it should work, but assuming the HW engineers made a mistake, what should the signals look like to find out what the issue is.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AFAIK the PHY leds are driven by hardware not software and therefore should blink if there is a link established. Do you receive a 'Link up' callback ?

Years ago I had a customer specific board for tests but the hardware developer forgot to design in resistors for the ethernet signal termination. For me it sounds like you have a hardware problem too. An evaluation board would be a good for cross checking signals with a scope.

SAME newbie

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I remember that the PHY address setup was confusing. Only 0 is valid or something like that. I think had to patch the code.

SAME newbie

Last Edited: Fri. Sep 29, 2017 - 11:21 AM