Go to www.sparkfun.com

 
It is currently Fri Jul 30, 2010 2:08 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Olimex SAM7-EX256 and EtherNUT works!
PostPosted: Mon Nov 27, 2006 3:18 am 
Offline

Joined: Sat Dec 03, 2005 4:15 am
Posts: 8
www.ethernut.de V4.2.1

It's running like a charme :)

The following changes were needed, to get it up and running:

I applied the following patch to EmacReset() in at91_emac.c

/* PHY ID */
#define MII_DM9161_ID_H 0x0181
#define MII_DM9161_ID_L 0xb8a0

#define MII_AM79C875_ID_H 0x0022
#define MII_AM79C875_ID_L 0x5540

#define MII_MICREL_ID_H 0x0022
#define MII_MICREL_ID_L 0x1610

/* For some unknown reason it seems to be required to read the ID
registers first. */
// Check for DM PHY (as used on the ATMEL EK)
if (phy_inw(NIC_PHY_ID1) != MII_DM9161_ID_H ||
(phy_inw(NIC_PHY_ID2) & 0xFFF0) != MII_DM9161_ID_L) {
// Check for MICREL PHY (as used on the Olimex SAM7-EX256)
if (phy_inw(NIC_PHY_ID1) != MII_MICREL_ID_H ||
(phy_inw(NIC_PHY_ID2) & 0xFFF0) != MII_MICREL_ID_L) {
outr(EMAC_NCR, inr(EMAC_NCR) & ~EMAC_MPE);
return -1;
}
}




The Olimex board uses another PHY (MICREL) I just patched enough, to get
it up and running.

Maybe this ID selection should also happen in the configurator, so
developers using a different kind of PHY have a chance to think about it :-)

And don't forget to set the right PHY address (31) and the PHY Powerdown bit (18). The PHY on the Olimex board also uses negated Powerdown polarity. So don't forget to set this either.

Please post your success in this thread.


Best regards
Marc


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 27, 2006 4:17 am 
Offline

Joined: Wed Nov 08, 2006 8:37 am
Posts: 11
Location: Übersee, Germany
Great.
I didn't have the time to look at ethernut and the differences to uip/freertos. I would like to hear about this topic. (Maybee open a new topic "uip/freertos vs. Ethernut"?)
uip is nice for me because I know the Tools. (I used to work for IAR). Unfortunately the compiler is limited to 32k. I have to find a way to move the file system to another project or switch to a cheaper tool or talk to my former boss.
What tools are you using? Is there a good debugger comparable to IAR-C-Spy that connects to J-Link?
Can you connect your board over dyndns.org so we all can play with it?
Regards,
Eduardo


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 27, 2006 4:34 am 
Offline

Joined: Sat Dec 03, 2005 4:15 am
Posts: 8
I use Ethernut for years, but until now only on the ATMEGAs.

I also use WinARM (or the very nice counterpart from yagarto + eclipse)
yagarto also has some nice howto's online, how to get it up and running.

As I dont have J-Link (but the cheap and nice JTAG adapter from Olimex) I
use H-Jtag to use it on the IAR workbench.

Speaking of a good IDE for my GNU tools, I am still getting my feet wet, I try this and that, and I will update some entries here if I found my personal "golden solution" without spending a car worth of money :-)

BR
Marc


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 15, 2006 11:23 am 
Offline

Joined: Fri Dec 15, 2006 11:19 am
Posts: 2
thanks for that. I now have ethernut up and running on my olimex board.
I do have a question though.. you mention to set 'negated powerdown polarity'... where would I set that?

thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 26, 2007 6:23 am 
Offline

Joined: Thu Dec 21, 2006 5:37 am
Posts: 12
at what point in the at91_emac.c do i add:

/* PHY ID */
#define MII_DM9161_ID_H 0x0181
#define MII_DM9161_ID_L 0xb8a0

#define MII_AM79C875_ID_H 0x0022
#define MII_AM79C875_ID_L 0x5540

#define MII_MICREL_ID_H 0x0022
#define MII_MICREL_ID_L 0x1610

/* For some unknown reason it seems to be required to read the ID
registers first. */
// Check for DM PHY (as used on the ATMEL EK)
if (phy_inw(NIC_PHY_ID1) != MII_DM9161_ID_H ||
(phy_inw(NIC_PHY_ID2) & 0xFFF0) != MII_DM9161_ID_L) {
// Check for MICREL PHY (as used on the Olimex SAM7-EX256)
if (phy_inw(NIC_PHY_ID1) != MII_MICREL_ID_H ||
(phy_inw(NIC_PHY_ID2) & 0xFFF0) != MII_MICREL_ID_L) {
outr(EMAC_NCR, inr(EMAC_NCR) & ~EMAC_MPE);
return -1;
}
}


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 2:53 am 
Offline

Joined: Thu Dec 21, 2006 5:37 am
Posts: 12
C:/ethernut-4.2.1/nut/arch/arm/dev/at91_emac.c:760: error: previous declaration of 'EmacRxThread' was here


what does this mean???


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 1:55 pm 
Offline

Joined: Thu Dec 21, 2006 5:37 am
Posts: 12
will the leds light with this patch?

is the patch a replacement for a section of lines or an addition?

I am despirate as I am doing this for a university project, and I have 3 weeks left to get a webserver running so that I can send udp reqests to investigate the suitability of ethernet for real time.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Template made by DEVPPL