Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
742 Views

Problem detecting PHY

Hi all, 

 

I am coding my ethernet manually without RTOS or Nichestack on the DE4. 

 

My first step was to reset the MAC. 

 

- That can be done successfully 

 

The second step was to init the MAC. 

 

alt_u8 i; alt_u16 phyid1, phyid2; /* perform scanning and get phy hardware */ for (i =0; i < 0x20; i++) { IOWR_ALTERA_TSEMAC_MDIO_ADDR0(TSE_MAC_BASE, i); /* read phy address */ phyid1 = IORD_ALTERA_TSEMAC_MDIO(TSE_MAC_BASE, 0, 2); phyid2 = IORD_ALTERA_TSEMAC_MDIO(TSE_MAC_BASE, 0, 3); IOWR_ALTERA_AVALON_PIO_DATA(PIO_LED_BASE, 15); if (phyid1 != phyid2){ printf ("phy found:id1 %x, id2 %x\n", phyid1, phyid2); break; } }  

 

I am unable to find the PHY. 

 

Any pointers ?  

 

Cheers
0 Kudos
11 Replies
Highlighted
Valued Contributor III
4 Views

Why not to use a driver, already supplied in examples?

0 Kudos
Highlighted
Valued Contributor III
4 Views

For my project, there are some licensing issues so I am trying to workaround them. 

 

Also, I faced problems getting the demo to work on my board so to cut things short I studied some code from a friend that has successfully done this. Unfortunately this colleague has left the company so I am left with chunks of his code to reverse. 

 

Hence hitting this wall. So any help would be greatly appreciated.
0 Kudos
Highlighted
Valued Contributor III
4 Views

Do you have a license for the Ethernet IP core? IF not, be sure not to close the opencores evaluation window. If you do then the TSE core will stop working and won't communicate on the MDIO lines. 

You can also use signaltap probes to see if anything is happening on those lines.
0 Kudos
Highlighted
Valued Contributor III
4 Views

 

--- Quote Start ---  

Do you have a license for the Ethernet IP core? IF not, be sure not to close the opencores evaluation window. If you do then the TSE core will stop working and won't communicate on the MDIO lines. 

You can also use signaltap probes to see if anything is happening on those lines. 

--- Quote End ---  

 

 

Well, this is strange. Say, I have no window at all because I ran from command line. Then, when I hit Ctrl+C or kill the programmer with "kill -9", the TSE core still works. For like an hour.
0 Kudos
Highlighted
Valued Contributor III
4 Views

I don't know how the evaluation works from the command line. But I know that if the JTAG communication is interrupted, then the core works for a limited amount of time, usually 1-2 hours. It's probably the same when killing the programmer application.

0 Kudos
Highlighted
Valued Contributor III
4 Views

I am running an evaluation license whereby I leave the board thethered to my pc so I think it is still running. 

 

I think the bigger problem would be that I am unable to communicate with the PHY through the MDIO
0 Kudos
Highlighted
Valued Contributor III
4 Views

Well, at least a driver supplied with LwIP example works for me. It even works fine with my custom PHY initialization structure: I use KSZ9021 1Gbit PHY from Micrel, which is not supported by default.

0 Kudos
Highlighted
Valued Contributor III
4 Views

You should check the MDIO signals with signaltap, and see if the PHY is trying to answer something on any of the 32 addresses

0 Kudos
Highlighted
Valued Contributor III
4 Views

And also check if You use MDIO tristate correctly.

0 Kudos
Highlighted
Valued Contributor III
4 Views

I have never set up signaltap but will check the state of the pins. 

 

I used the system builder to setup the pins on the board so no idea. 

 

Thanks. 

 

p.s. Socrates, is there a guide on how to use LWIP with the TSE without an RTOS? or some kind of example? I'm a bit of a newbie so need as much help as I can. Thanks
0 Kudos
Highlighted
Valued Contributor III
4 Views

ok' I've checked the pins and it says unknown for the pins. But I can't change them as they are read only. 

 

Ok. Update. Checked the pins and there are signals going out. But I am unable to decipher the stream. What is more worrying not is that examples refuse to run in the new workspace I've created to test LWIP. 

 

I think I might have done something really wrong. I installed the freertos and LWIP port for 11.0 and have used the create application from template. The ethernet cable is connected and there are no errors during compile. 

 

It seems that the task to start the ethernet is not running. I have deliberately placed a printf for a simple message in there and it does not show. So no prizes there. 

 

I see so many of getting it to work....surely there must be some light ?...... Please ?
0 Kudos