[RESOLVED] MQX Lite --Task Stack(s) Corrupted

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[RESOLVED] MQX Lite --Task Stack(s) Corrupted

Jump to solution
699 Views
thisobj
Contributor III

Running FRDM-KL46Z, CW 6  CW v10.6, Component MQX Lite V1.0.0 (also tried with V1.1.0). Also a problem on KDS with V1.1.1.

Code: Simple MQX Lite with 3 tasks. It appears that the Idle task stack initial value falls inside the boundaries for Task2Stack.  The interrupt stack initial value falls inside the boundaries for Task3Stack. The screen shot shows the base stack values while in a breakpoint inside Task 2 using the OpenSDA debugger, Windows 7 x86.

Stackprob.jpg

I searched through the forums, but could find nothing citing this sort of stack problem.  It should be easy to duplicate. by setting up a similar project in either CW 6  CW v10.6 or KDS.

Frank

Message was edited by: Frank Volker - CW Version used was CW v10.6. Changed "CW 6" instances to proper version: "CW v10.6"

0 Kudos
1 Solution
376 Views
thisobj
Contributor III

The actual task stack address (top of stack) is an entry in the task descriptor which is contained in the bottom 108 bytes of the task stack. The address of this descriptor is what is called (for example) "Task2_task_stack" in the generated file, MQX1.C.  After closer inspection, I saw that the allocated stack size included this descriptor, which is placed at the very bottom of the stack--108 bytes below the Stack Limit, which is the bottom of the actual working stack.

Frank

View solution in original post

0 Kudos
1 Reply
377 Views
thisobj
Contributor III

The actual task stack address (top of stack) is an entry in the task descriptor which is contained in the bottom 108 bytes of the task stack. The address of this descriptor is what is called (for example) "Task2_task_stack" in the generated file, MQX1.C.  After closer inspection, I saw that the allocated stack size included this descriptor, which is placed at the very bottom of the stack--108 bytes below the Stack Limit, which is the bottom of the actual working stack.

Frank

0 Kudos