Hi Nicola,
you're welcome.
My K64 project is setup with FreeRTOS and KSDK2.0.
I changed the ethernet_callback() to notify a low priority task about the new packet. The handling is done in this task.
With MQX you can do something equivalent.
You can have a look on my source.
The callback with IRQ context.
void ethernet_callback(ENET_Type *base, enet_handle_t *handle, enet_event_t event, void *param)
{
#if !NO_SYS
portBASE_TYPE xWake = pdFALSE;
#endif
switch (event)
{
case kENET_RxEvent:
// post info from IRQ context to task
// instead of handling ist direct!!!!
// by MS
//
// A RTOS is being used. Signal the Ethernet interrupt task.
//
/* Notify the task that the transmission is complete. */
vTaskNotifyGiveFromISR( xTaskToNotifyETH, &xWake );
// don't call this in IRQ context (long working time)
// ethernetif_input(handle, param);
break;
default:
break;
}
//
// Potentially task switch as a result of the above notify write.
//
portEND_SWITCHING_ISR(xWake);
}
The simple, low priority Task.
static portTASK_FUNCTION( lwIPInterruptTask, pvParameters )
{
/* The parameters are not used. */
( void ) pvParameters;
//
// Loop forever.
//
while(1)
{
//
// Wait until the notify has been signalled.
//
// xTaskToNotifyETH
ulTaskNotifyTake( pdTRUE, portMAX_DELAY );
ethernetif_input(&g_handle, &fsl_netif0);
}
}
Have a nice weekend.
Best regards
Manfred