STM32 Ethernet Demo

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
rubenswerk
Posts: 104
Joined: Wed Feb 22, 2012 11:39 am

Re: STM32 Ethernet Demo

Post 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(&ETHD1);
#endif


Next step: will try to add lwip and the webserver demo.
Bye!
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32 Ethernet Demo

Post by Giovanni »

Hi, I fixed that error in the repository, thanks for finding.

Giovanni
Jacon
Posts: 143
Joined: Wed Dec 08, 2010 7:52 am
Has thanked: 50 times
Been thanked: 5 times

Re: STM32 Ethernet Demo

Post 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 :oops:

I sent you wrong mii.h file :!:

Enclosed pls find the proper one
(Content of previous zip file already fixed, too)
Attachments
mii.zip
(2.42 KiB) Downloaded 530 times
Last edited by Jacon on Mon Apr 02, 2012 11:14 pm, edited 1 time in total.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32 Ethernet Demo

Post by Giovanni »

I added this modified mii.h to the repo, thanks.

Giovanni
rubenswerk
Posts: 104
Joined: Wed Feb 22, 2012 11:39 am

Re: STM32 Ethernet Demo

Post 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
isiora
Posts: 4
Joined: Wed Feb 16, 2011 9:41 pm

Re: STM32 Ethernet Demo

Post 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
kgysmits
Posts: 20
Joined: Tue May 03, 2011 10:16 am

Re: STM32 Ethernet Demo

Post by kgysmits »

ST has some more PLL design/verification to do then I guess. And an errata to add.
Thanks for letting us know!
Jacon
Posts: 143
Joined: Wed Dec 08, 2010 7:52 am
Has thanked: 50 times
Been thanked: 5 times

Re: STM32 Ethernet Demo

Post 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...
Jacon
Posts: 143
Joined: Wed Dec 08, 2010 7:52 am
Has thanked: 50 times
Been thanked: 5 times

Re: STM32 Ethernet Demo

Post 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 :mrgreen:
Ping response < 1ms, http access perfectly well.

Needless to say, Giovanni - we approaching really mature state of ChibiOS/RT :D :!:
Attachments
ChibiOS_trunk_STM32F4_lwIP.zip
(44.03 KiB) Downloaded 607 times
Jacon
Posts: 143
Joined: Wed Dec 08, 2010 7:52 am
Has thanked: 50 times
Been thanked: 5 times

Re: STM32 Ethernet Demo

Post 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 :D
Attachments
changes.zip
(14.47 KiB) Downloaded 522 times
Post Reply