DisablePHY() gives error when compiling

Discussion to talk about software related topics only.
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

DisablePHY() gives error when compiling

Post by v8dave »

Hi all,

I have a small test programme from the forum to do power reduction but I can't get the Ethernet power functions to compile.

If I use EnablePHY or DisablePHY in the code I get the following error when compiling.

undefined reference to 'DisablePHY()'

ethernet.h is included.

I am using a MOD5234 board with the dev kit.

Dave...
khoney
Posts: 125
Joined: Fri Sep 11, 2009 12:43 pm

Re: DisablePHY() gives error when compiling

Post by khoney »

I just got this error as well - code compiled and linked yesterday, and I haven't even modified the file in which this function is called.
rsg
Posts: 54
Joined: Thu May 15, 2008 5:36 am

Re: DisablePHY() gives error when compiling

Post by rsg »

That's because said function does not exist:

Code: Select all

$ find ~/Nburn -name '*.h' | xargs grep 'DisablePHY'
$
See, nothing found!

In fact:

Code: Select all

$ find ~/Nburn | xargs grep 'DisablePHY'
grep: ~/Nburn/MOD5234/include/ETPU/originals/NND: No such file or directory
grep: ETPU: No such file or directory
grep: SET.txt: No such file or directory
$
Still nothing found! :P
User avatar
pbreed
Posts: 1087
Joined: Thu Apr 24, 2008 3:58 pm

Re: DisablePHY() gives error when compiling

Post by pbreed »

Any release Rel23_rc4 or later has DisablePHY.
ethernet.cpp in nburn\MOD5234\system\ethernet.cpp line 1396 in my version.
User avatar
lgitlitz
Posts: 331
Joined: Wed Apr 23, 2008 11:43 am
Location: San Diego, CA
Contact:

Re: DisablePHY() gives error when compiling

Post by lgitlitz »

The source for the enable and disable phy functions are the last two functions in the ethernet.cpp source file. They were added to the NNDK 7/28/2008 and should be in all builds >= 23rc1.
I just realized that these functions can only be used in a release builds. This is due to the fact that the normal ethernet.cpp source file is not part of debug builds. A quick fix for this is to just move the two functions from ethernet.cpp to etherprint.cpp and recompile the system library. You should probably also add the following 3 lines to the top of the funtions:
#ifdef _DEBUG
EtherInit();
#endif

-Larry
rsg
Posts: 54
Joined: Thu May 15, 2008 5:36 am

Re: DisablePHY() gives error when compiling

Post by rsg »

Oops! Yes, I did find them here at home, on release 2.3 RC7. Wonder what I have at work (when I did those finds...) Sorry, I thought that was current too... :oops:

So, what version does the OP have? Perhaps it is too old?
User avatar
pbreed
Posts: 1087
Joined: Thu Apr 24, 2008 3:58 pm

Re: DisablePHY() gives error when compiling

Post by pbreed »

The file version 1.10
From CVS
Rel22_rc2: 1.9 is the last release to have version 1.9 so anything newer than that has it.
The debug release maynot have it as Larry noted a few posts ago.

Paul
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: DisablePHY() gives error when compiling

Post by v8dave »

It kind of makes sense too as you use the Ethernet for debugging but it would have been nicer to have a compiler pragma or error if debug is enabled?

I'll trying building a release version to test it out.

Dave...
khoney
Posts: 125
Joined: Fri Sep 11, 2009 12:43 pm

Re: DisablePHY() gives error when compiling

Post by khoney »

Somewhat related to this topic...

I was successful in disabling the PHY and stopping the processor on my 5270B Rev1.6 module. I then tried doing a warm reset (taking RSTI low). The network PHY does not appear to be resetting. On a rev 1.1 module schematic (the latest one I could find, but with a different PHY), the RSTO is tied to the PHY. Is this not the case with the newer modules, and if not, why not? I would think a module reset should reset everything on the module, since we only have control over the RSTI pin.

FYI, I'm running Rel24_RC2 of the NNDK. I noticed some comments in the file related to warm reset and the PHY that were supposed to have been corrected?
User avatar
lgitlitz
Posts: 331
Joined: Wed Apr 23, 2008 11:43 am
Location: San Diego, CA
Contact:

Re: DisablePHY() gives error when compiling

Post by lgitlitz »

I just the reset while the PHY is powered down and had no issue. I tried both resetting the board by pulling RSTI low and also a soft reset by calling forcereboot(). I did this while in PHY power down mode on a 1.6 version of the MOD5270B. The board came back up and got a link instantly. Can you recover the PHY by calling EnablePHY(); ?

There was a hardware change to the MOD5270B to allow power down mode for the PHY. The older 1.5 version of the MOD5270B will not be able to recover from PHY power down mode but the 1.6 version should be fine. This is the current revision that is being shipped.
Post Reply