cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet problem

ali_dehbidi
Senior
Posted on April 20, 2013 at 12:46

Dear all

I have made a custom board based on stm32f407IGT6 and used the same schematics from keil MBCSTM32F400 board, I have written this simple program for testing PING,I'm using keil tools

int main(void)

{

         SysTick_Config(SystemCoreClock/100);      /* Generate interrupt each 10 ms  */

         init_TcpNet ();

        while(1)

        {

                main_TcpNet();

        }

}

void SysTick_Handler (void)

{

    timer_tick ();

}

Also I have made this change into Net_Config.c file

&sharpdefine TICK_INTERVAL 10

my PC does show that it has found some activity on the lan and the link leds will light up and for a bout 1 minute the yellow led will blink too, but the board does not respond with the ping,

here are the content of ST802RT1A registers,

PHY_REG_CNTRL=0x00001000;

PHY_REG_STATS=0x0000786D;

PHY_REG_PHYID1=0x00000203;

PHY_REG_PHYID2=0x00008461;

PHY_REG_LDADV=0x000005E1;

PHY_REG_LPADV=0x0000C1E1;

PHY_REG_ANEGX=0x0000000F;

PHY_REG_LDNPG=0x00002801;

PHY_REG_LPNPG=0x00000000;

PHY_REG_XCNTL=0x00001000;

PHY_REG_XSTAT=0x00000300;

PHY_REG_XRCNT=0x00000100;

PHY_REG_XCCNT=0x000011D8;

PHY_REG_XDCNT=0x0000000A;

PHY_REG_AUXCS=0x0000002B;

PHY_REG_AUXSS=0x0000F53E;

PHY_REG_AUXM2=0x0000000A;

PHY_REG_TSTAT=0x0000082B;

PHY_REG_AMPHY=0x000080E0;

PHY_REG_RN1F=0x00000000;

PHY_REG_RS1B=0x0000000A;

Do you know what's going wrong?

#cross-post
8 REPLIES 8
Posted on April 20, 2013 at 13:06

Does the same code/configuration work on the MCBSTM32F400?

Does the magnetics you use have the same ratio?

Is the centre tap correct?

Are the clocks correct? Measure.

Do you have a schematic for the design of your PCB?

Do you have a BOM for you design?

How do these differ from the reference design?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ali_dehbidi
Senior
Posted on April 20, 2013 at 14:04

I do not have the MCBSTM32F400 board, But I think the example will work on that board,

I have used the RJ000002 for the RJ45 connector,

http://www.javanelec.com/RJ000pdf

Here I have attached my schematics in pdf,

________________

Attachments :

Ethernet.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1Fs&d=%2Fa%2F0X0000000bkJ%2FCUucpNaChJp7uD_YrnqkkYQWeQn3DJOVbGMTVtC4Hf8&asPdf=false

MCU.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1FP&d=%2Fa%2F0X0000000bkI%2FiUKIHhDkMgCXWN5ClSFHtsJji6RiczbRjhbhfuWvarQ&asPdf=false
Posted on April 20, 2013 at 14:45

Cross-post:

http://www.keil.com/forum/22914

Posted on April 20, 2013 at 15:18

Well nothing is jumping out of the schematic right now.

Concentrate on the clocks.

Check the cabling, would be very helpful to have a working board to contrast with.

Do some more basic ethernet testing, ie 802.3 packet transmission/reception, not TCP/IP.

Perhaps use a cross-over cable to a PC with the Ethernet card in Promiscuous mode, or a Network Analyzer.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ali_dehbidi
Senior
Posted on April 20, 2013 at 17:42

Thanks for your help,

How do I do Ethernet basic tests? I do not know how? I have just set the Ethernet derive to be 10MB and now my PC detects the link as 10MB,Also I have used the straight and cross over cables,both of them behave like the same, Some of the read only reserved words on the PHY registers just read something else but every thing else make sense in the PHY, except that the last register says we have an MLT3 error detected, I do not it's meaning and it's cause?Do you have any Idea?

Posted on April 20, 2013 at 18:39

I'd use a network card which I understood the hardware/software of, and had driver code written for. Then I'd be able to generate traffic over the wire, and receive data from the wire. Understand what is, and what is not working.

The TCP Ping is a bit far up the layers to diagnose the physical wiring and electronics.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ali_dehbidi
Senior
Posted on April 20, 2013 at 21:26

Do you recommend any tools or software or tutorials? I'm dying to figure out the problem.

Posted on April 21, 2013 at 02:32

A scope and the MCBSTM32F400 would be a good starting reference. I'll assume your access to commercial tools is limited given where you are situated.

You could perhaps use Wireshark, a bunch of cables and an old dumb hub (ie not a switch). I might look for a old NE2000 or 3C509 cards to use in promiscuous mode, you might have better luck with a micro-controller based Ethernet peripheral like the one you're trying to use, but a working one with a driver.

In terms of ''Instant knowledge in a can'' I find Google and Bing to be most useful, if someone has taken the time to write a tutorial and put it online these search engines will have spidered it, plug in some terms and topics.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..