about task stack and RTOS - Programmers Heaven

Howdy, Stranger!

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


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

about task stack and RTOS

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


  • allskylineallskyline Posts: 6Member
    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.