RTX166 Tiny User's Guide

Stack Management

RTX166 Tiny maintains a system stack and a user stack for each task using only on-chip memory memory. When a task is running, it is given the maximum amount of stack space possible. When a task switch occurs, the previous task stack is shrunk and relocated and the stack for the current task is expanded and relocated.

The following figure illustrates the layout of internal memory for an example application with three separate tasks.

This figure illustrates now both the system stack and user stack are allocated. SYSSTKBOT is the symbol used for the System Stack Bottom and SYSSTKTOP is the symbol used for the System Stack Top. USRSTKBOT is the symbol used for the User Stack Bottom and USRSTKTOP is the symbol used for the User Stack Top.