cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 freeRTOS gets stuck at xQueueSemaphoreTake while debugging using Visual Studio Code

RDodd.1
Associate II

Hi ,

I am using Cortex debug extension in Visual studio code to debug my STM32F4 custom board . I am successfully able to debug using CubeIDE . But with Visual studio code the code hangs at the below line of queue.c .

configASSERT(pxQueue->uxItemSize == 0);

So my question is , do I have to explicitly specify or enable the RTOS debugging ?

2 REPLIES 2
Bob S
Principal

If execution stays on that line it means the assert failed (i.e. uxItemSize != 0 when expecting ==0). What do the comments just above that line say about why it requires size==0? What function is this in? Typically this is used to tell queues from semaphores (which use queues as the underlying code).

Are you running EXACTLY the same binary image under CubeIDE and VSCode? Of is it being re-compiled by VSCode (perhaps using different compiler versions and/or optimization settings)?

hs2
Senior

From experience this assert is often hit on internal data corruption caused by stack overflows.

I bet your task stack sizes are just too small. I’d also recommend to enable FreeRTOS stack checking for development.