DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
Under certain conditions, it may be necessary to create a kernel thread whose stack likes in some custom memory. This page provides and example of how that would be done:
Example
Here is the body of some function. It expects to have the following inputs:
...
/* Then activate the task at the provided priority */
ret = task_activate((FAR struct tcb_s *)tcb);
if (ret < 0)
{
nxtask_uninit(tcb);
custom_free(stack);
return ret;
}
return OK;
Freeing the Custom Stack Memory
The effect of the TCB_FLAG_CUSTOM_STACK flag is the the OS will not attempt to free the custom stack memory if the task exits, crashes, or is killed. Does this matter in your implementation? Could this result in some kind of memory leak? If any kind of clean-up is required by your application to free the custom stack memory, you will probably want to use an on_exit() or atexit() function to get a callback when the task is terminated.