cancel
Showing results for 
Search instead for 
Did you mean: 

Having issue with calling MX_LWIP_Init() in StartDefaultTask and creating socket in another task

rudolf.pribis
Associate II

My program suppose to be like following:

  • defaultTask - MX_LWIP_Init
  • serverTask - my FUTURE purpose (using socket)
  • ntpclientTask - ntp purpose (using socket)

Once I call MX_LWIP_Init() in defaultTask a got stuck in ntpclientTask on

socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP ); // Create a UDP socket.

at queue.c

BaseType_t xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition )
{
BaseType_t xEntryTimeSet = pdFALSE, xYieldRequired;
TimeOut_t xTimeOut;
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
 
	configASSERT( pxQueue );

If I call MX_LWIP_Init() ans socket(...) in same task I have no issue.

Any idea how I can call MX_LWIP_Init() ans socket(...) in different tasks?

Thank you

Rudo

2 REPLIES 2
Piranha
Chief II

Well, You have to ensure that API is used only after initialization is completed. By the way, if defaultTask has the lowest priority, it starts executing as the last one.

Thanks a lot, it was my case.