...
µC/OS-III’s statistic task calls OSTaskStkChk()
for each task created and stores the results in each task’s OS_TCB
so your application doesn’t need to call this function if the statistic task is enabled.
Arguments
p_tcb
is a pointer to the TCB of the task where the stack is being checked. A NULL
pointer indicates that the user is checking the calling task’s stack.
...
If OS_CFG_CALLED_FROM_ISR_CHK_EN
set to 1
in os_cfg.h
: if calling this function from an ISR.
Returned Value
None
Notes/Warnings
- Execution time of this task depends on the size of the task’s stack.
- The application can determine the total task stack space (in number of
CPU_STK
elements) by adding the value of*p_free
and*p_used
. This number should add up to the task’s stack size which is stored in the.StkSize
field of theOS_TCB
of the task. - The
#define
CPU_CFG_STK_GROWTH
must be declared (typically fromos_cpu.h
). When this#define
is set toCPU_STK_GROWTH_LO_TO_HI
, the stack grows from low memory to high memory. When this#define
is set toCPU_STK_GROWTH_HI_TO_LO
, the stack grows from high memory to low memory.