about task stack and RTOS

Can i put the task stacks into the external space of [b]8051 MCU[/b]?!
And i cant' understand the concept of task stack?!


  • hi,
    In a RTOS, such as uCOS, CooCox CoOS..., each task has its own stack. Actually, task stack refers to a continuous area in RAM. When we create a task, we need to give the base address and size for its stack (that is the first address and size of a storage area in RAM).
    Task stack has two functions:
    1. When a task is running, it is used to save local variables in this task.
    2. When a task is suspended, it is used to save task's status, that is to save CPU registers's value. And when this task is activated, it resumes its status from the task stack.

    Obviously, you can use external RAM as task stack. But before you use, you should consider that in general the speed in externl RAM is much slower than internal RAM, if your task has high require about time and real-time, you'd better to use internal RAM as task stack.

    [link=http://www.coocox.org]www.coocox.org[/link] (a free and open RTOS)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion