Page 13 of 26
Re: STM32 Ethernet Demo
Posted: Sat Mar 31, 2012 7:20 pm
by rubenswerk
I was not aware what Jacek's demo does, I thought it would be a port of the complete webserver, but I guess I was wrong

But it shows that the MAC works, the red LED on my board responds on Ethernet traffic.
Thank you Jacek!
I ran into two small problems, just as feedback:
1.
MII_DP84848I_ID is not defined (should be 83848?). However, also 83848 is not defined.
I found 0x080017 as OUI in the DP83848 datasheet and added it into mii.h. Don't know if this is the correct PHY_ID - I guess not, because it didn't work.
2.
So I defined BOARD_PHY_ADDRESS with a value of 1 (according to DP83848's default strapping option). With that configuration, I had to fix mac_lld_init():
Code: Select all
#if defined(BOARD_PHY_ADDRESS)
// phyaddr = BOARD_PHY_ADDRESS << 11; causes a compiler error
ETHD1.phyaddr = BOARD_PHY_ADDRESS << 11;
#else
mii_find_phy(ÐD1);
#endif
Next step: will try to add lwip and the webserver demo.
Bye!
Re: STM32 Ethernet Demo
Posted: Sat Mar 31, 2012 7:59 pm
by Giovanni
Hi, I fixed that error in the repository, thanks for finding.
Giovanni
Re: STM32 Ethernet Demo
Posted: Sat Mar 31, 2012 11:01 pm
by Jacon
rubenswerk wrote:1.
MII_DP84848I_ID is not defined (should be 83848?). However, also 83848 is not defined.
I found 0x080017 as OUI in the DP83848 datasheet and added it into mii.h. Don't know if this is the correct PHY_ID - I guess not, because it didn't work.
Ooppss -my mistake
I sent you wrong mii.h file
Enclosed pls find the proper one
(Content of previous zip file already fixed, too)
Re: STM32 Ethernet Demo
Posted: Sun Apr 01, 2012 10:59 am
by Giovanni
I added this modified mii.h to the repo, thanks.
Giovanni
Re: STM32 Ethernet Demo
Posted: Sun Apr 01, 2012 11:51 pm
by rubenswerk
Just wanted to let you know that I got the webserver demo running. It was quite easy, took only 20 minutes, even for me as a beginner.
Just added some stuff from the lwip demo makefile, the ../web/ code, and some small changes to main.c
So I reached my goal and got the demo running this weekend. Thanks for your support.
Bye, Ruwe
Re: STM32 Ethernet Demo
Posted: Mon Apr 02, 2012 3:01 pm
by isiora
Hi,
I have further confirmation of my hypothesis regard the MCO issue.
This morning a FXO-HC73 oscillator has arrived (stability +/-50ppm).
I placed and soldered it close to the discovery microphone chip so as to inject the clock right on the pin PC9 (the worst possible place, 10cm away from the PHY on my board).
Now everything is working perfectly. I tested it using up to 150 meters of Cat5 cable without problems.
Isidoro
Re: STM32 Ethernet Demo
Posted: Mon Apr 02, 2012 4:15 pm
by kgysmits
ST has some more PLL design/verification to do then I guess. And an errata to add.
Thanks for letting us know!
Re: STM32 Ethernet Demo
Posted: Mon Apr 02, 2012 11:23 pm
by Jacon
Sorry, Giovanni,
Missed below quoted note from Ruwe:
rubenswerk wrote:MII_DP84848I_ID is not defined (should be 83848?).
That worked fine (cause wrong no consistently everywhere) - now both above zip files fixed,
with proper MII_DP83848I_ID mark...
Re: STM32 Ethernet Demo
Posted: Tue Apr 03, 2012 11:16 am
by Jacon
Just completed mine version of lwIP 1.4.0 enhanced STM32F4-Discovery demo.
Following lines
mostly repeated from my previous post, for newcomers
Hardware changes:
- R50 (0 Ohm) removed from Discovery board,
- analog poti moved from PC1 to PC2
- USART2's TX/RX moved from PA2,PA3 to PD5,PD6, respectively.
- DP83848 connection in RMII mode is possible in only one way (9 signal lines + VCC/GND)
Enclosed pls find all changed/added files from/to original Giovanni's STM32F4-Discovery demo.
They add functionality from trunk\demos\ARMCM3-STM32F107-LWIP\ to normal STM32F4-Discovery demo functions,
removing all previous functions (especially SPI driven) impossible now.
Ethernet activity is signaled with green LED on RJ45 socket & red LED on Discovery board.
Red LED is turned steady on during Test thread activity, too.
Linker script file in CCM + ETH version, MAC driver buffers & descriptors no increased
and all moved to 16kB F4 additional RAM

Ping response < 1ms, http access perfectly well.
Needless to say, Giovanni - we approaching really mature state of ChibiOS/RT

Re: STM32 Ethernet Demo
Posted: Tue Apr 03, 2012 12:21 pm
by Jacon
Giovanni,
Just tested a.m. demo with latest lwIP 1.4.1 version from their git repo,
which, among other fixes, have that with checksums processing, as mabl
mentioned previously...
Only cosmetic changes in lwip.mk & lwipopts.h needed & everything works
again like a charm.
Now will try using hardware checksums & other possible improvements
