lpcware

Ethernet DMA not receiving RX packets from Ethernet PHY chip

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
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.

Outcomes