cancel
Showing results for 
Search instead for 
Did you mean: 

Stuck in xQueueSemaphoreTake()

debug
Associate III

Hi,

I would like to setup a system with a telnet server and I'm trying to follow this guide: https://controllerstech.com/stm32-ethernet-4-tcp-server/ but unfortunately, upon launch, the system gets stuck at line1438 in queue.c:

/* Cannot block if the scheduler is suspended. */

#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )

{

configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );

}

#endif

it's a bit odd because it appears like when I don't change the MEM_SIZE variable but leave it its default (1600) it appears to not be stuck after creation of the config but once I change it to 10*1024 (as it's shown in the link above) I do not seem to be able to undo it anymore but it keeps getting stuck on call to MX_LWIP_Init(). Why is this I'm wondering and how can I fix it?

10 REPLIES 10

**IF** your code fails exactly as the original post, then you are calling MX_LWIP_Init() when the FreeRTOS task scheduler is in the SUSPENDED state.  I do not know how cmsis_os v1 works.  In cmsis_os v2, "suspended" means the scheduler has been started via osKernelStart() which calls vTaskStartScheduler().  But the RTOS scheduler has been suspended - either from an ROTS critical section or an explicit call to vTaskSuspendAll().  Note that in cmsis os v2  "suspended" is different than "never started".  That may not be the case in cmsis os v1.