Maybe this is something to do with the EMAC errata
mentioned on the NXP's website. Depending on the
rev. of the chip, you need to set the PINSELx
differently.
http://www.standardics.nxp.com/products/lpc2000/new/~LPC2468/#LPC2468
See errata and get an update of the S/W bundle(Under Support
Docs) which has the example how to set the PINSELx,
initialize the MAC and PHY.
regards,
Tom
--- In l..., Mikael Helbo Kj wrote:
>
> Hi all
>
>
>
> I am testing a board design and I have run into a very strange
problem. I
> have an Ethernet MAC initialization routine based on
examples
found around
> the net for my lpc2468 however the software will not
run. The
processor
> works as it runs other software testing out parts of
the board.
However when
> I run the following code sequence:
>
>
>
> PINSEL2 = 0x10151105; /* selects P1[0,1,4,6,8,9,10,14]
*/
>
> PINSEL3 = 0x00000005; /* selects P1[17:16] */
>
> /* turn on the ethernet MAC clock in PCONP, bit 30 */
>
> PCONP |= PCONP_EMAC_CLOCK;
>
> delayMs(1); /* Wait 1 ms */
>
> /* write the MAC config registers */
>
> MAC_MAC1 = 0xCF00; /* [15],[14],[11:8] -> soft resets all MAC
internal
> modules */
>
> MAC_COMMAND = 0x0038; /* reset all datapaths and host
registers
> */
>
>
>
> delayMs(1); /* Wait 1 ms */
>
> MAC_MAC1 = 0x00; /* deassert all of the above soft
resets in
> MAC1 */
>
>
>
> I never get past the final line accessing MAC_MAC1. After the store
> instruction removing the reset the processor freezes and won't
even let me
> access it through JTAG (making me debug by blinking
LEDs the code
for that
> removed from the above example). The only way to get
it back under
my
> control is to reflash the device. If I run any other
of my test
code
> everything is fine. Reading through the assembly has
not revealed
anything
> strange going on only the mov, str and bl
instructions you'd
expect. I am
> using the Yagarto GCC distribution, but I have used
that and my
setup for
> other ARM projects before.
>
>
>
> Question: Is there anything obvious to other people on this list
that I
> should do differently to initialize the Ethernet MAC?
Or in
general have any
> suggestions on this topic?
>
>
>
> Best regards
>
> Mikael
>
> Software Engineer @ IO-Connect
>
>
>
>
>