lpcware

lpc1768 freertos lwip

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by _whoami_ on Sun Feb 15 03:18:34 MST 2015
Hi,

I am trying to get freertos in conjunction with lwip to work. Therefore I am using the lpcopen_2_10_lpcxpresso_nxp_lpcxpresso_1769/webserver_freertos example program.

All task are running and an additional LED blinky task too.
UART0 is also working for debug purposes.

Now my problem is that sending an etharp_gratuitous(netif); is not working. I have traced this function and found out it is crashing in  Chip_ENET_IncTXProduceIndex.
In that function pENET->CONTROL.TX.PRODUCEINDEX = idx; is called and right after this instruction see my debug print from the Default_Handler ...

void Default_Handler(void) {
// Go into an infinite loop.
//

DEBUGSTR("Default_Handler ...................");
while (1) {
}

}


I thought of some multi thread problems during breakpoint debugging and added some DEBUG print instructions like

uint16_t Chip_ENET_IncTXProduceIndex(LPC_ENET_T *pENET)
{
/* Get current TX produce index */
uint32_t idx = pENET->CONTROL.TX.PRODUCEINDEX;

/* Start frame transmission by incrementing descriptor */
idx++;
if (idx > pENET->CONTROL.TX.DESCRIPTORNUMBER) {
idx = 0;
}

//PASCAL
DEBUGSTR("New INDEX\r\n");

pENET->CONTROL.TX.PRODUCEINDEX = idx;

//PASCAL
DEBUGSTR("Return\r\n");

return idx;
}


BUT after "New INDEX" I get "Default_Handler ..................." on my UART terminal.

Also if I try to ping the ip address from my PC the lpc1768 program crashes. If I put an breakpoint at the start of the ETH_IRQHandler I never get there even if I ping that device ?!?!? But the controller still crashes :weird:

I think there is something wrong on the low level side.
I know it is much guessing now but I do not know how to solve that problem. No idea where to start :(

EDDDDIIIIIITTTTTTTTTTTTTTT !!!!!!!!!!!!!!!!!!!!!

OMG there is a difference between ENET_IRQHandler and ETH_IRQHandler :shamed:

Outcomes