Ok, since I posted this message yesterday, I have had better luck with frame filtering.
Previously, I followed the example of the MAC driver and set the frame filter and hash tables etc. in the low level initialization of the Mac driver. The settings themselves were successful as I could read and verify the settings in the ethernet registers.
Now, I have moved the hash table and mac frame filter register setting to after all low level initialization was finished. In fact, I do this now after my application has started up entirely. I made the change by accident.
So my question changes to this: why does this work? I am not too happy with the idea that something works by chance and would like to know why it does now and did not previously.
Thanks.
I have included just the MAC driver's low level init call (from lpc18xx_43xx_mac.c) with the detail of where the non-working settings changes were made previously
/* Low level init of the MAC and PHY */
static err_t low_level_init(struct netif *netif)
{
struct lpc_enetdata *lpc_netifdata = netif->state;
/* Initialize via Chip ENET function */
Chip_ENET_Init(LPC_ETHERNET);
/* Save MAC address */
Chip_ENET_SetADDR(LPC_ETHERNET, netif->hwaddr);
/* Initial MAC configuration for checksum offload, full duplex,
100Mbps, disable receive own in half duplex, inter-frame gap
of 64-bits */
LPC_ETHERNET->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 filter */
#if IP_SOF_BROADCAST_RECV
LPC_ETHERNET->MAC_FRAME_FILTER = MAC_FF_PR | MAC_FF_RA; /* <<This is where I my frame filter settings go. (Yes, IP_SOF_BROADCAST_RECV is set ) . The changed line looked like this: LPC_ETHERNET->MAC_FRAME_FILTER = MAC_FF_PM; This was the setting that does not work*/
#else
LPC_ETHERNET->MAC_FRAME_FILTER = 0; /* Only matching MAC address */
#endif
/* Initialize the PHY */
#if defined(USE_RMII)
if (lpc_phy_init(true, msDelay) != SUCCESS) {
return ERR_IF;
}
intMask = RDES_CE | RDES_DE | RDES_RE | RDES_RWT | RDES_LC | RDES_OE |
RDES_SAF | RDES_AFM;
#else
if (lpc_phy_init(false, msDelay) != SUCCESS) {
return ERR_IF;
}
intMask = RDES_CE | RDES_RE | RDES_RWT | RDES_LC | RDES_OE | RDES_SAF |
RDES_AFM;
#endif
/* Setup transmit and receive descriptors */
if (lpc_tx_setup(lpc_netifdata) != ERR_OK) {
return ERR_BUF;
}
if (lpc_rx_setup(lpc_netifdata) != ERR_OK) {
return ERR_BUF;
}
/* Flush transmit FIFO */
LPC_ETHERNET->DMA_OP_MODE = DMA_OM_FTF;
/* Setup DMA to flush receive FIFOs at 32 bytes, service TX FIFOs at
64 bytes */
LPC_ETHERNET->DMA_OP_MODE |= DMA_OM_RTC(1) | DMA_OM_TTC(0);
/* Clear all MAC interrupts */
LPC_ETHERNET->DMA_STAT = DMA_ST_ALL;
/* Enable MAC interrupts */
LPC_ETHERNET->DMA_INT_EN =
#if NO_SYS == 1
0;
#else
DMA_IE_NIE | DMA_IE_AIE | DMA_IE_RIE | DMA_IE_TIE;
#endif
/* Enable receive and transmit DMA processes */
LPC_ETHERNET->DMA_OP_MODE |= DMA_OM_ST | DMA_OM_SR;
/* Enable packet reception */
LPC_ETHERNET->MAC_CONFIG |= MAC_CFG_RE | MAC_CFG_TE;
/* Start receive polling */
LPC_ETHERNET->DMA_REC_POLL_DEMAND = 1;
return ERR_OK;
}