This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Slow memory leak in idle task?

More weirdness.  I have an idle task (default supplied by TI-RTOS), stack and heap checking active, deleted task clean-up enabled.

I'm spinning a BLDC motor.  Each cycle (motion one direction 4 seconds, then back four 4 seconds) I break in the debugger to check the states of my tasks.

Stack peak never changes - EXCEPT foir the idle task!  First at 124.. then after a few cycles, it jumps to 240.. then a few more cycles later, it jumps to 292.. and a bit later I get a stack overflow error, the ROV says it's pointing at invalid memory, and it's reset time.

Are there any known issues that might cause this?  I have no custom idle functions, this is all TI code.

Ed Averill

  • Hi Ed,

        So if you have no custom idle functions then maybe there's a chance that it's something you're doing in your other task that could be corrupting the idle tasks stack. One way you can check this is to use ROV to find the Idle Tasks stack base address. Then, in your debugger put a watch point on that address to detect the code that attempts to write to that address.

    Let me know if this helps.

    Moses

  • Great suggestion!  I found a couple of things and finally traced it to a call in an interrupt routine that was trashing the stack, the idle task thing turned out to be a red herring.

    Ed Averill