This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C5505 Stack and System Stack with DSP/BIOS



All:

I am using the C5505. Some questions on Stack and System Stack. Here is a paragraph from a 55x workshop:

"The C55x contains two stack pointers: SP and SSP. The SP is the normal User Stack that contains the lower 16 bits of the return address (for calls or interrupts). It also holds the values of any values pushed onto the stack. The System Stack (SSP) is a special-purpose stack that only contains the upper bits of the return address for calls and interrupts. The user does not usually access the system stack because it does not contain any pushed data. Once the user sets up the system stack, it is best to leave it alone."

Questions:

1. When allocating space for Stack and System Stack, should they be given the same amount of memory?

   For instance, if Stack is given 0x400, should System Stack be given the same amount?

2. When there is a need to increase stack size, does the System Stack also need to be increased?

3. We are using DSP/BIOS - does that environment set up the mode for use of stacks?

   It appears that the default stack size is 0x400 for Stack and 0x100 for System Stack.

   If the stack size is increased to 0x600, does the System Stack also need to be increased by a similar size, say 0x100 --> 0x180?

 

 

  • The amount of System Stack required for an application depends on the memoy model chosen. See the compiler user's manual section 6.1 for details:

        http://www.ti.com/lit/ug/spru281g/spru281g.pdf

    For 'small' model applications, very little, if any, System stack is used since all code/data pointers are only 16 bits.

    For 'large' and 'huge' model applications, the System Stack is used more heavily to push and pop the upper 8 bits of code/data pointers.

    For 'large' and 'huge' model applications, you do NOT need to allocate the same amount of space for the stack and system stack since 16 bit data push/pops do not effect the system stack ptr.

    I believe the Stack/SysStack size proportions given by the default values in DSP/BIOS are a good rule-of-thumb however your application requirements may vary.

    Alan