Page 12 of 26

Re: STM32 Ethernet Demo

Posted: Thu Mar 29, 2012 8:40 am
by Giovanni
Isidoro,

Before giving up, could you change the clock settings in mcuconf.h and make the PLL work with 2MHz in input instead of 1MHz? That could reduce the jitter.

Giovanni

Re: STM32 Ethernet Demo

Posted: Thu Mar 29, 2012 10:52 am
by isiora
Giovanni,

It was one of the first test I did, shortly before you've suggested that. More, I tried also with a laboratory grade external clock generator in place of the 8MHz crystal (to exclude the latter).
IMHO this issue is closed, at least with this revision (A) of the F4 chip.

Isidoro

Re: STM32 Ethernet Demo

Posted: Thu Mar 29, 2012 10:56 am
by rubenswerk
Hm, interesting news.

If you take a look at the MAC description in the manual, when they talk about clock sources:
For MII, the MCO is listed as an option for 25MHz clock.
For the RMII mode, they only talk about using an external oscillator.

This is bad for isioara because a redesign is needed anyways, but hopefully MII can be used.
It should work because as far as I remember, the HSE clock can be routed directly to MCO without going through the PLL.

So a single 25MHz crystal should be fine to clock both the F4 and the MII PHY.
The Micrel PHY might be an interesting choice if it can internally double the 25MHz to work in RMII mode. I have no experience with the Micrels.

Bye, Ruwe

Re: STM32 Ethernet Demo

Posted: Thu Mar 29, 2012 11:21 am
by isiora
Thanks Ruwe,

of course I read datasheet and reference manual thoroughly, so I had doubts it would work.
But I equally wanted to try... the board is easily 'patchable'.

Isidoro

Re: STM32 Ethernet Demo

Posted: Thu Mar 29, 2012 5:44 pm
by Jacon
Just adapted my STM32F4-Discovery demo with stuff from \testhal\STM32F1xx\MAC,
added red LED blink to see frame receive activity and everything works perfectly well
with my Chinese DP83848I PHY board :mrgreen:

So Giovanni - good work with your MAC driver :D

Next step - lwIP...

Re: STM32 Ethernet Demo

Posted: Thu Mar 29, 2012 5:57 pm
by Giovanni
Thanks, good to know :-)

Giovanni

Re: STM32 Ethernet Demo

Posted: Fri Mar 30, 2012 9:17 pm
by rubenswerk
Hello,

I also got my Chinese DP83848 board today, and I'd like to combine it with F4 discovery and ChibiOS this weekend.
What is a good starting point for the adaptation?
Shall I start with the lwip demo for the Olimex board and re-configure it for the Discovery board?
As far as I understood Jacon, I can take the Discovery demo and add parts of makefile and main.c from \testhal\STM32F1xx\MAC.
Of course I need to set the correct port configuration in board.h.
What else do I have to change?

Jacon, if it would be ok for you to post your adaptations, this would simplify my first steps into the world of F4 ethernet.

Have a nice weekend!
Ruwe

Re: STM32 Ethernet Demo

Posted: Fri Mar 30, 2012 9:29 pm
by Giovanni
Probably starting from the existing demo is a good idea, make sure to update the Makefile and take the mcuconf.h from an F4 demo, clock parameters are different.

I just received an Olimex STM32-P407 (donated by Matthias), I will add a lwIP demo for that one too.

Giovanni

Re: STM32 Ethernet Demo

Posted: Fri Mar 30, 2012 9:59 pm
by Jacon
Hi Ruwe,

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 - described in your previous post :D

Enclosed pls find all changed files from original Giovanni's demo.

They add functionality from \testhal\STM32F1xx\MAC to normal STM32F4-Discovery demo functions,
removing all previous functions (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.

Have a nice try :)
Jacek

Re: STM32 Ethernet Demo

Posted: Sat Mar 31, 2012 4:00 pm
by rubenswerk
Thanks so much to you guys. Very active community here!
I linked this thread in the mikrocontroller.net discussion board, because the MCO question was still unanswered there.
I will let you know about my progress.