Skip to main content
Visitor II
December 13, 2023
Question

Endless loop at configASSERT( pxQueue->uxItemSize == 0 );

  • December 13, 2023
  • 4 replies
  • 4315 views

Hi all

I'm pretty sure this was already a topic, but i haven't found a solution yet. Since i'm a beginner i definitely need some help here.

I'm sending UDP data with LWIP and FreeRTOS. It works, but after some (random) time the code gets stuck at  

 

Screenshot 2023-12-13 125302.png
 
configASSERT( pxQueue->uxItemSize == 0 );
 
I tried some settings but nothing helps. It is stopping even if I do not send data .
 
Any ideas?
 
Cheers
    This topic has been closed for replies.

    4 replies

    Visitor II
    December 13, 2023

    A stack overflow might cause this kind of internal data corruption. Did you enable stack checking ? See https://www.freertos.org/Stacks-and-stack-overflow-checking.html

    MFäh.1Author
    Visitor II
    December 13, 2023

    Thank you for your reply.

     

    Yes, i did. My ioc file has following FreeRTOS settings (maybe this helps)

    FREERTOS.FootprintOK=true
    FREERTOS.IPParameters=Tasks01,configMINIMAL_STACK_SIZE,configUSE_NEWLIB_REENTRANT,copyHeapFile,FootprintOK,configENABLE_FPU,configCHECK_FOR_STACK_OVERFLOW,configQUEUE_REGISTRY_SIZE
    FREERTOS.Tasks01=defaultTask,24,256,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL;
    FREERTOS.configCHECK_FOR_STACK_OVERFLOW=1
    FREERTOS.configENABLE_FPU=1
    FREERTOS.configMINIMAL_STACK_SIZE=256
    FREERTOS.configQUEUE_REGISTRY_SIZE=0
    FREERTOS.configUSE_NEWLIB_REENTRANT=0
    FREERTOS.copyHeapFile=1

     

    Cheers

     

    Graduate II
    December 13, 2023

    This might be a buffer overrun resulting in the memory at pxQueue being stomped.  I'd suggest looking at what's in memory prior to pxQueue for clues.

    Visitor II
    December 13, 2023

    Also try FREERTOS.configCHECK_FOR_STACK_OVERFLOW=2 and ensure that you have configASSERT defined. (sorry, I’m not familiar with cube)

    BTW what’s the stack size(s) you’re using for your task(s) ?

    MFäh.1Author
    Visitor II
    December 14, 2023

    Thank you both for your replies. I try to test both, not sure if I do it correctly ;-). 

    @David Littell : "I'd suggest looking at what's in memory prior to pxQueue for clues". Does this help somehow: 

    MFh1_0-1702542633591.png

     

    Stack size for the taks is, if I'm correct 256 (words).

    Cheers

    Graduate II
    December 14, 2023

    It does look like the queue structure in memory is being stomped by something.  As a quick test you could try 4x all the stacks.  You can also convert the uxMessagesWaiting value to hex and see if that's a memory address you can examine.

    Issues like this force you to dig around and work to really understand what's being allocated versus statically defined in memory - simple IDE debugger snippets aren't usually enough.

    Explorer
    December 9, 2025

    Hello,

    I'm having the same problem.

    how have you solved it?

     

    Best regards.