This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to define a bigger stack for a task

there are 10 tasks in our application,
stack size definition in RTX_cinfig is default setting
as follows:

// <o>Task stack size [bytes] <20-4096:8><#/4>
// Set the stack size for tasks which is assigned by the system.
//
Default: 200
#ifndef OS_STKSIZE #define OS_STKSIZE 50
#endif

one of the 10 taskes is overflow now, how to define a
bigger stack for the task. thanks in advice!

Parents
  • try this:

    define global variable in beginning of your file, then at init create your task (first name of task, then priority, then pointer to stack and its size). Hereby an example for an bigger stack for tcp_task I use:

    U64 tcp_stack[800/8];                        /* A bigger stack for tcp_task */
    
    t_tcp_task = os_tsk_create_user (tcp_task, 0, &tcp_stack, sizeof(tcp_stack));
    

    that's it. Also change the number of processes with user stack in RTX_Config file

    //   <o>Number of tasks with user-provided stack <0-250>
    //    Define the number of tasks that will use a bigger stack.
    //    The memory space for the stack is provided by the user.
    //    Default: 0
    #ifndef OS_PRIVCNT
     #define OS_PRIVCNT     4
    #endif
    

    Here I can have 4 processes with user provided stack

    hopes this helps

Reply
  • try this:

    define global variable in beginning of your file, then at init create your task (first name of task, then priority, then pointer to stack and its size). Hereby an example for an bigger stack for tcp_task I use:

    U64 tcp_stack[800/8];                        /* A bigger stack for tcp_task */
    
    t_tcp_task = os_tsk_create_user (tcp_task, 0, &tcp_stack, sizeof(tcp_stack));
    

    that's it. Also change the number of processes with user stack in RTX_Config file

    //   <o>Number of tasks with user-provided stack <0-250>
    //    Define the number of tasks that will use a bigger stack.
    //    The memory space for the stack is provided by the user.
    //    Default: 0
    #ifndef OS_PRIVCNT
     #define OS_PRIVCNT     4
    #endif
    

    Here I can have 4 processes with user provided stack

    hopes this helps

Children
No data