EmbeddedRelated.com
Forums
Memfault Beyond the Launch

LPC2468 ethernet problem

Started by bqba...@yahoo.com December 26, 2008
Hi all,

I am doing a ARM7 board using LPC2468 (NXP) and DP83848C PHY (National).
After layout and assembly the board, I am testing the board and face a strange problem. That is: The EMAC can not receive frame with start byte equal 0x00. I send a frame with all the byte 0x00 to PC and I can capture it with ethereal. From PC, I do a ping to the board. It can see the ARP request (with start byte is 0xFF) and do answer. But after that, it can not see the ICMP echo request (with start byte is 0x00). I did a loopback test in EMAC with this code:
MAC_MAC1 = (MAC1_PASS_ALL | (1<<4));

And all thing is the same. If I send a frame with 0xAA55 or any thing as long as start byte is not 0x00, I can receive it. But with 0x00, I can not capture it (MAC_RXPRODUCEINDEX did not change)

I think this problem do not come from PHY or noise, etc. Because this loop back only in the EMAC.
Can any one help me solve this problem.
Sorry about my poor English.

An Engineer's Guide to the LPC2100 Series

It's not all that clear out of your description if with all 0x00 you
refer to the complete ethernet frame or some protocol areas of it (cause
you mention ICMP et all).

Anyways, frames starting with the first bit (destination adress) cleared
are unicast frames. So, it sounds to me like you have eventually
programmed your own MAC address the wrong way. That easily can happen
cause the documentation on this is VERY unclear if not to say plain
missleading. Even the example code in the files section of this forum
did it wrong.

I posted something on this subject a while ago (can't remember where in
the docs what, but if you search for posts of mine you should find it
quick as I don't post so often).

You should see everything if you configure the EMAC for promisious mode,
but that you should do for debugging, not as a fix of the problem.

HTH

Markus

b...@yahoo.com schrieb:
>
> Hi all,
>
> I am doing a ARM7 board using LPC2468 (NXP) and DP83848C PHY (National).
> After layout and assembly the board, I am testing the board and face a
> strange problem. That is: The EMAC can not receive frame with start
> byte equal 0x00. I send a frame with all the byte 0x00 to PC and I can
> capture it with ethereal. From PC, I do a ping to the board. It can
> see the ARP request (with start byte is 0xFF) and do answer. But after
> that, it can not see the ICMP echo request (with start byte is 0x00).
> I did a loopback test in EMAC with this code:
> MAC_MAC1 = (MAC1_PASS_ALL | (1<<4));
>
> And all thing is the same. If I send a frame with 0xAA55 or any thing
> as long as start byte is not 0x00, I can receive it. But with 0x00, I
> can not capture it (MAC_RXPRODUCEINDEX did not change)
>
> I think this problem do not come from PHY or noise, etc. Because this
> loop back only in the EMAC.
> Can any one help me solve this problem.
> Sorry about my poor English.
>
>
Dear Markus,

Thank you for your early reply.
Finally, I solved my problem. It come from the filter register.

I programed the MAC_RXFILTERCTRL reg with 0x07 instead of
MAC_RXFILTERCTRL = RFC_MCAST_EN | RFC_BCAST_EN | RFC_PERFECT_EN. After
that I can ping and get a simple website from the board.

But now, my MAC capture all packet and slow down the performance.

To make the story short, I reproduce the code here I use to initialize
the mac and filter register.

/* write the station address (MAC address) registers. Note, the
documentation on how the station address shall be written into the
registers is misleading at least. Aparently NXP sees the last digit of
the mac address as the "first octet" (the other way round as the
reminder of the world does). */
MAC_SA0 = ( OurMac[5] << 8 ) + OurMac[4];
MAC_SA1 = ( OurMac[3] << 8 ) + OurMac[2];
MAC_SA2 = ( OurMac[1] << 8 ) + OurMac[0];

The code to init the filter register follows.

/* Set up RX filter, accept broadcast and perfect station. */
MAC_RXFILTERCTRL = RFC_BCAST_EN | RFC_PERFECT_EN;

This way only packets your application most likely is interested in
(true broadcasts and packets addressed to your own MAC address) are
passed in.

HTH

Markus

b...@yahoo.com schrieb:
>
> Dear Markus,
>
> Thank you for your early reply.
> Finally, I solved my problem. It come from the filter register.
>
> I programed the MAC_RXFILTERCTRL reg with 0x07 instead of
> MAC_RXFILTERCTRL = RFC_MCAST_EN | RFC_BCAST_EN | RFC_PERFECT_EN. After
> that I can ping and get a simple website from the board.
>
> But now, my MAC capture all packet and slow down the performance.
>
>
thank you very much,

Now the ethernet in my board is OK. I am testing the USB part and face
another problem :((

I config the USB device to USB2 and USB host to USB1. I can not get the
USB_CONNECT_2 work.

I read the test register and the result is 0xA50F. OK. I had the clock running.

I write 1 to the CON bit, and read back. Yes, this bit is set to 1. But the USB_CON_2 (P1.30) still HIGH.

In the manual, the PORTSEL register has the address 0xFFE0 C110, and the OTG status and Control reg has the same addr. Is it right? I write 0x03 to the PORTSEL and read back OK.

Every thing seem OK but not work :<<

Would you please give me any suggestion?

Thank in advance

Hi all,
>
>I am doing a ARM7 board using LPC2468 (NXP) and DP83848C PHY (National).
>After layout and assembly the board, I am testing the board and face a strange problem. That is: The EMAC can not receive frame with start byte equal 0x00. I send a frame with all the byte 0x00 to PC and I can capture it with ethereal. From PC, I do a ping to the board. It can see the ARP request (with start byte is 0xFF) and do answer. But after that, it can not see the ICMP echo request (with start byte is 0x00). I did a loopback test in EMAC with this code:
>MAC_MAC1 = (MAC1_PASS_ALL | (1 <

You best post this as something totally new (USB related subject), cause
it's very likely that only people which were interested to follow this
ethernet related thread will read this message.

HTH

Markus

b...@yahoo.com schrieb:
>
> thank you very much,
>
> Now the ethernet in my board is OK. I am testing the USB part and face
> another problem :((
>
> I config the USB device to USB2 and USB host to USB1. I can not get the
> USB_CONNECT_2 work.
>
> I read the test register and the result is 0xA50F. OK. I had the clock
> running.
>
> I write 1 to the CON bit, and read back. Yes, this bit is set to 1.
> But the USB_CON_2 (P1.30) still HIGH.
>
> In the manual, the PORTSEL register has the address 0xFFE0 C110, and
> the OTG status and Control reg has the same addr. Is it right? I write
> 0x03 to the PORTSEL and read back OK.
>
> Every thing seem OK but not work :<<
>
> Would you please give me any suggestion?
>
> Thank in advance
>
> Hi all,
> >
> >I am doing a ARM7 board using LPC2468 (NXP) and DP83848C PHY (National).
> >After layout and assembly the board, I am testing the board and face
> a strange problem. That is: The EMAC can not receive frame with start
> byte equal 0x00. I send a frame with all the byte 0x00 to PC and I can
> capture it with ethereal. From PC, I do a ping to the board. It can
> see the ARP request (with start byte is 0xFF) and do answer. But after
> that, it can not see the ICMP echo request (with start byte is 0x00).
> I did a loopback test in EMAC with this code:
> >MAC_MAC1 = (MAC1_PASS_ALL | (1 <
>
>
Thank you very much
Hi all,
>
>I am doing a ARM7 board using LPC2468 (NXP) and DP83848C PHY (National).
>After layout and assembly the board, I am testing the board and face a strange problem. That is: The EMAC can not receive frame with start byte equal 0x00. I send a frame with all the byte 0x00 to PC and I can capture it with ethereal. From PC, I do a ping to the board. It can see the ARP request (with start byte is 0xFF) and do answer. But after that, it can not see the ICMP echo request (with start byte is 0x00). I did a loopback test in EMAC with this code:
>MAC_MAC1 = (MAC1_PASS_ALL | (1 <

Search this group for problems related to setting the MAC address of the
controller propperly. I posted a code snipet a week or two ago which
initializes the MAC adress and registers and from what your post sounds
is very likely to solve the issue.

HTH

Markus

b...@yahoo.com schrieb:
>
> Thank you very much
>
> Hi all,
> >
> >I am doing a ARM7 board using LPC2468 (NXP) and DP83848C PHY (National).
> >After layout and assembly the board, I am testing the board and face
> a strange problem. That is: The EMAC can not receive frame with start
> byte equal 0x00. I send a frame with all the byte 0x00 to PC and I can
> capture it with ethereal. From PC, I do a ping to the board. It can
> see the ARP request (with start byte is 0xFF) and do answer. But after
> that, it can not see the ICMP echo request (with start byte is 0x00).
> I did a loopback test in EMAC with this code:
> >MAC_MAC1 = (MAC1_PASS_ALL | (1 <
>
>

Memfault Beyond the Launch