CRC error when dhcp_start() used

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by tjoAG on Wed Feb 17 07:54:03 MST 2016
Hi all

We have used the lwip 1.4.x for some years now, with static IP.
It worked an still works great.

I try to enable DHCP but I got some problems.

When I have called dhcp_start(), all received ethernet frames are rejected by lpc_low_level_input with a CRC error. (lpc_enetif->prxs[idx].statusinfo == EMAC_RINFO_CRC_ERR) See below on how I star the DHCP.

I'm running lwip in FreeRTOS on a LPC1788

Any ideas?

This is what I do: (Basically the same as always, but with a call to
#define LWIP_DHCP                       1
#define LWIP_UDP                        1
// Add zero static IP
IP4_ADDR(gw, 0, 0, 0, 0);
IP4_ADDR(ipaddr, 0, 0, 0, 0);
IP4_ADDR(netmask, 0, 0, 0, 0);
// Setup interface
memset(&lpc_netif, 0, sizeof(lpc_netif)); netif_add(&lpc_netif, &ipaddr, &netmask, &gw, NULL, lpc_enetif_init, tcpip_input); // Enable MAC interrupts NVIC_SetPriority(ENET_IRQn, configEMAC_INTERRUPT_PRIORITY/*((0x01 << 3) | 0x01)*/); NVIC_EnableIRQ(ENET_IRQn); // Use DHCP??
    // start dhcp
   // Just for testing...
   while(lpc_netif.dhcp->state != DHCP_BOUND)
     // Wait a bit