xSemaphoreTake function looping at configASSERT( pxQueue->uxItemSize == 0 );

rohitsay89 wrote on Thursday, October 17, 2019:

I found it !
I am using sprintf in another task to create a string and append an uint8_t variable to it. When I use the watchpoints as mentioned in previous therad, I saw that the memory location was written by corrupted by sprintf and was never recovered back to be used by semaphore. So the SRAM location for item size has that corrupted value and when it is being read by config assert it hangs the processor to that infinite loop.
I removed that sprintf and kept the bin semaphore as dynamic allocation, and it works perfectly fine. I am using strcpy for now. Is there any better alternative to sprintf for int and floats ?

To answer your question, Cube MX software has that visual tool to generate and configure all the required peripherals and FreeRTOS configurations as well, it has binary semaphore also.

Thanks for your help ! I hope this thread does help someone who needs it
Regards,
Rohit

1 Like