I am having issues with polling using the LWIP example program.
If I directly use the sample program, polling by calling the RX / TX ISR function as is works correctly.
When I attempt to integrate this exact code into my program I get stuck in the RX ISR in the while loop
while(hdkif_swizzle_data(curr_bd->flags_pktlen) & EMAC_BUF_DESC_SOP)
It is entering the RX handler immediately because rxintstatraw is set to 1, but stuck in the loop because
if((hdkif_swizzle_data(curr_bd->flags_pktlen) & EMAC_BUF_DESC_OWNER) != EMAC_BUF_DESC_OWNER)
This if statement is not satisfied. Therefore it skips all the code in the RX ISR handler and updates curr_bd with the following:
curr_bd = rxch->active_head;
but curr_bd has not updated and is still set to the same value. Even if I attempt to send an ethernet request to the device, it is still stuck in this loop and does not enter the if statement, nor exit the while loop.
I thought there might be an issue with the rxintstatraw register so I used this tickets enable of the MACINVECTOR register. But this register also gets set and I'm still stuck.
Is there any advice for where I might have gone wrong? I am currently using a static IP setup which reports on the SCI port a success
uint8 ip_addr[4] = { 172, 16, 0, 246 }; uint8 netmask[4] = { 255, 255, 0, 0 }; uint8 gateway[4] = { 172, 16, 0, 1 }; ipAddr = lwIPInit(0, emacAddress, *((uint32_t *)ip_addr), *((uint32_t *)netmask), *((uint32_t *)gateway), IPADDR_USE_STATIC);
I have the same lwipopts and opts.h settings as the example program