2011-09-30 11:33 AM
Hi
I have a problem in Ethernet start up using LWIP. the program always stick in a infinite loop in below line :while (ETH_GetSoftwareResetStatus () == SET)
what is problem and what is this line means ? i use an external 50Mhz oscillator( RMII Mode )
instead of using Port A.8 forDP83848
clock source ! can this cause the problem ? thanks #mainwaring2011-10-01 01:40 AM
while( ETH_GetSoftwareResetStatus() == SET )
''what is this line means?''That is a very basic 'C' construct! If you really don't know what it means, then you need to spend some time to update your 'C' skills! In 'C', a
while
loop will continue until the condition becomes 'true' - in the above example, the loop will continue until the value returned byETH_GetSoftwareResetStatus()
is equal toSET
''what is problem'' From understanding what the loop does (see above) it should be obvious that, if the loop never exits, thenETH_GetSoftwareResetStatus()
is never returning a value equal toSET
!
You must study the documentation forETH_GetSoftwareResetStatus()
to find what conditions are necessary for it to return a value equal toSET
You could also examine the source code. You could also investigate using the debugger.2011-10-01 12:49 PM
Hi
i think you are kidding with me ! of course i know about the C construct. my question is when this flag toggles and why ? regards2011-10-01 02:27 PM
''of course i know about the C construct''
So why did you ask what it means?''my question is when this flag toggles and why ?''
What does the function's documentation say?
Have you used the debugger to find out?
2011-10-01 02:48 PM
hi again and thanks for your quick reply
this line is in the ( stm32f2x7_eth_lwip ) library and the only things that i find for this line is below comment : Checks whether the ETHERNET software reset bit is set or not. debugger shows that this function always return SET and program stick in this line ! so i don't know what is the software reset2011-10-02 12:07 AM
''debugger shows that this function always return SET''
So look inside the function - and see what causes it to return that value!
2011-10-10 03:27 AM
Hi,
- Remove jumper JP5 - Remove the following lines from the code: /* Output PLL clock divided by 2 (50MHz) on MCO pin (PA8) to clock the PHY */ RCC_MCO1Config(RCC_MCO1Source_PLLCLK, RCC_MCO1Div_2); and try again2011-10-10 12:41 PM
''in the above example, the loop will continue until the value returned by
ETH_GetSoftwareResetStatus()
is equal toSET''
A slightly important typo there Neil :)2011-10-10 04:03 PM
I wondered who'd be the first to spot that...
;)2011-10-19 12:23 PM
Did you ever figure out an answer to this? I'm trying to bring up the LwIP demo on a custom built STM32F107 board and I'm stuck in the same place. However, I am using MII mode w/ the 25 MHz output on PA8.
From what I understand, the SR bit should clear itself eventually if the necessary clocks are all enabled. Obviously the next step is to delve further into the manual, errata, and the stm32_eth.c library. However any hints to point in the right direction would be helpful.