Skip to main content
rudolf.pribis
Associate III
Apr 18, 2019 2:30 PM UTC
Question

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

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

This topic has been closed for replies.

2 replies

Piranha
Principal III
Apr 23, 2019 6:34 PM UTC

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.

rudolf.pribis
Associate III
Apr 25, 2019 5:50 PM UTC

Thanks a lot, it was my case.