DisablePHY() gives error when compiling
DisablePHY() gives error when compiling
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...
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...
Re: DisablePHY() gives error when compiling
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.
Re: DisablePHY() gives error when compiling
That's because said function does not exist:
See, nothing found!
In fact:
Still nothing found! 
Code: Select all
$ find ~/Nburn -name '*.h' | xargs grep 'DisablePHY'
$
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
$

Re: DisablePHY() gives error when compiling
Any release Rel23_rc4 or later has DisablePHY.
ethernet.cpp in nburn\MOD5234\system\ethernet.cpp line 1396 in my version.
ethernet.cpp in nburn\MOD5234\system\ethernet.cpp line 1396 in my version.
Re: DisablePHY() gives error when compiling
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
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
Re: DisablePHY() gives error when compiling
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...
So, what version does the OP have? Perhaps it is too old?

So, what version does the OP have? Perhaps it is too old?
Re: DisablePHY() gives error when compiling
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
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
Re: DisablePHY() gives error when compiling
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...
I'll trying building a release version to test it out.
Dave...
Re: DisablePHY() gives error when compiling
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?
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?
Re: DisablePHY() gives error when compiling
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.
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.