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

RL-ARM: "stack overflow" depending on task creation order?

My ARM7 software is using the RT environment of RL-ARM.

After adding a new tiny task Task8 to the previous 7 tasks, "os_stk_overflow" is called with the "task_id" pointing to Task8.

- Reducing the amount of code in Task 8 does not fix it (I reduced it to a simple for{;;} - loop)

- Increasing the task stack size in "RTX_conf.c" does not fix it.

- Changing the creation order of the tasks, i.e. calling os_tsk_create(task8) before os_tsk_create(task7), does fix it ("os_stk_overflow" is not called anymore)

So what are the other reasons beside a stack issue that is calling the "os_stk_overflow"?

Parents
  • Reducing the code size in general does not help, however reducing the local variables does. Maybe you have an array or a big structure declared in Task8.

    The stack overflow detection is not a 100% reliable, it might also fail. This is because the Stack Pointer and a signature value are checked on a task switch.

    Check local variables for all of your tasks and move big structures and arrays to global. This will not change the RAM requirements, but will avoid such problems that you have.

Reply
  • Reducing the code size in general does not help, however reducing the local variables does. Maybe you have an array or a big structure declared in Task8.

    The stack overflow detection is not a 100% reliable, it might also fail. This is because the Stack Pointer and a signature value are checked on a task switch.

    Check local variables for all of your tasks and move big structures and arrays to global. This will not change the RAM requirements, but will avoid such problems that you have.

Children