It is possible that the stack is exhausted because of many nested
subroutine calls or an extensive use of large automatic
variables.
If Stack Checking is enabled, the kernel can detect the stack
exhaustion problem and execute the system error function. The
application will hang in an endless loop inside the error function
with parameter err_code set to OS_ERR_STK_OVF. You can
identify the task id with isr_tsk_get() function. Check the
Active Tasks debug
dialog for the task name.
The solution to this problem is to increase the stack size for all
tasks in the configuration
file. If only one task requires a big stack and RAM is limited, you
can create this
task with a user-provided stack space.
OS_STKCHECK enables the Stack Checking algorithm. It must
be set to 1 to enable it or 0 to disable it. It is
enabled by default.
#define OS_STKCHECK 1
Enabled Stack Checking slightly decreases the kernel
performance because on every task switch the kernel needs to
execute additional code for stack checking.
On stack overflow a runtime system error function is
called.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.