9 years, 10 months ago.

[LPC1768] Ethernet -> setting rx/tx descriptors hangs MBED

Hello Guys,

Currently I'm working on the implementation of ethernet support in the MBED (LPC1768). The PHY is DP83848J

I use the following files (default) for this implementation: lpc17xx_emac.h lpc17xx_emac.c

I have only added some code to set the correct pin configuration for the ethernet pins on the LPC1768.

The failure that I get is that the MBED hangs when the following 2 functions are initiated: /* Initialize Tx and Rx DMA Descriptors */ rx_descr_init (); tx_descr_init ();

When I comment these lines, I see that the MBED keeps on operating (blink a led).

What could be the cause of this, that the descriptors make the MBED go in hangup?

[UPDATE]

When I decrease the number of possible fragments:

  1. define EMAC_NUM_RX_FRAG 1 /< Num.of RX Fragments 4*1536= 6.0kB */
  2. define EMAC_NUM_TX_FRAG 1 /< Num.of TX Fragments 3*1536= 4.6kB */

And uncomment tx_descr_init (); then the MBED does not hang. same goes when I only uncomment rx_descr_init ();

I looked up the USB tx and rx buffer, which is written by a colleague: total size of the buffer is 10kB. When I decreased this I could init both RX and TX for the ethernet, with a size of 2 and 2.

Is there a way to check the space usage / free space?

Thanks in advance,

Be the first to answer this question.