Hi All:
Even more late :-)
As Mark pointed out, this is a race condition with the xmit portion:
--------------------------------------------------------
static err_t
low_level_output(struct netif *netif, struct pbuf *p)
{
.... //Filling buffers and stuff like that
/* only one task can be here. wait until pkt is sent, then go ahead */
/* semaphore released inside isr */
/*start expiring semaphore: no more than 3 ticks*/
/*no blocking code*/
xSemaphoreTake( xTxENETSemaphore, 3/*1/portTICK_RATE_MS*//*portMAX_DELAY*/);
/* Request xmit process to MAC-NET */
enet->tdar = MACNET_TDAR_TDAR_MASK;
return ERR_OK;
}
-------------------------
ISR_PREFIX
void vENETISRHandler( void )
{
unsigned long ulEvent;
portBASE_TYPE xHighPriorityTaskWoken = pdFALSE;
#if (MACNET_PORT==0)
volatile macnet_t *enet = (macnet_t *)MACNET_BASE_PTR;
#else
volatile macnet_t *enet = (macnet_t *)(MACNET_BASE_PTR+MAC_NET_OFFSET);
#endif
/* Determine the cause of the interrupt. */
ulEvent = enet->eir & enet->eimr;
enet->eir = ulEvent;
/*Tx Process: only aware of a complete eth frame*/
if( /*( ulEvent & MACNET_EIR_TXB_MASK ) ||*/ ( ulEvent & MACNET_EIR_TXF_MASK ) )
{
/* xmit task completed, go for next one! */
xSemaphoreGiveFromISR( xTxENETSemaphore, &xHighPriorityTaskWoken );
}
/*Rx process*/
{
...//more stuff
}
/*Error handling*
{
...//more stuff
}
portEND_SWITCHING_ISR( xHighPriorityTaskWoken );
}
--------------------------------------------------------
After that fix I was not able to see other packets get stuck for next xmit.
Hope it helps there, probably not to you guys