Ethernet DMA not receiving RX packets from Ethernet PHY chip

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ethernet DMA not receiving RX packets from Ethernet PHY chip

924 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ashgupta28 on Wed Feb 18 01:53:35 MST 2015
Hello,

I am using custom board with LPC18xx with Micrel KSZ8873. I had configured ethernet switch port 3 as RMII with LPC18xx. I am also getting RX data packets on Oscilloscope at RMII RXD lines but these packets are not visible on DMA RX buffer.
These are the ethernet settings i am doing:-

Chip_ENET_RMIIEnable(LPC_ETHERNET);

Chip_Clock_EnableOpts(CLK_MX_ETHERNET, true, true, 1);

reset(pENET);

/* Setup MII link divider to /102 and PHY address 1 */
//Chip_ENET_SetupMII(pENET,div, 1);

/* Enhanced descriptors, burst length = 1 */
pENET->DMA_BUS_MODE = DMA_BM_ATDS | DMA_BM_PBL(1) | DMA_BM_RPBL(1);

/* Initial MAC configuration for checksum offload, full duplex,
   100Mbps, disable receive own in half duplex, inter-frame gap
   of 64-bits */
pENET->MAC_CONFIG = MAC_CFG_BL(0) | MAC_CFG_IPC | MAC_CFG_DM |
MAC_CFG_DO | MAC_CFG_FES | MAC_CFG_PS | MAC_CFG_IFG(3);


/* Setup default filter */
pENET->MAC_FRAME_FILTER = MAC_FF_PR | MAC_FF_RA ;

/* Flush transmit FIFO */
pENET->DMA_OP_MODE = DMA_OM_FTF;

/* Setup DMA to flush receive FIFOs at 32 bytes, service TX FIFOs at
   64 bytes */
pENET->DMA_OP_MODE |= DMA_OM_RTC(1) | DMA_OM_TTC(0);

/* Clear all MAC interrupts */
pENET->DMA_STAT = DMA_ST_ALL;

/* Enable MAC interrupts */
pENET->DMA_INT_EN = 0;/* Enable MAC interrupts */

Board_ENET_GetMacADDR(macaddr);
Chip_ENET_SetADDR(LPC_ETHERNET, macaddr);


/* Setup descriptors */
InitDescriptors(TXDescs, ENET_NUM_TX_DESC, RXDescs, ENET_NUM_RX_DESC);
/* Attach a buffer to a RX descriptor and queue it for receive */
i = 0;
while (i < ENET_NUM_RX_DESC) {
ENET_RXQueue(RXBuffer, EMAC_ETH_MAX_FLEN);
i++;
}
static_txNextIndex = 0;
Chip_ENET_RXStart(LPC_ETHERNET);
/* Enable RX/TX after descriptors are setup */
Chip_ENET_TXEnable(LPC_ETHERNET);
Chip_ENET_RXEnable(LPC_ETHERNET);


/* Check for receive packets */
workbuff = ENET_RXGet(&rxBytes); Here Inside, code is NOT going inside the loop :-
                                                                            if ((rxAvail < rxNumDescs) && (!(RXDescs[rxGet].STATUS & RDES_OWN))) {



Please suggest some settings that i have missed out.
Ashish Gupta

Please suggest what settings i have missed out.
Labels (1)
0 Kudos
1 Reply

655 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by xianghuiwang on Tue Apr 28 19:49:54 MST 2015
Hi,
You could bring up the Ethernet example in the LPCOpen package and compare the setup sequence and register setting with your code. Setup the oscilloscope to see if all the physical signals are as expected as well...

http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc18xx-packages-0

Regards!
0 Kudos