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.

TM4C1294NCPDT: Initialization of system stack in conjunction with RTOS

Part Number: TM4C1294NCPDT


Hi,

I have a question related to the system stack size of the TM4C1294 chip.

I'm using the default startup file from TI, which declares and initializes the system stack size as follows (excerpt):

;******************************************************************************
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
;******************************************************************************
Stack   EQU                        0x00001000

;******************************************************************************
; Allocate space for the stack.
;******************************************************************************
               AREA                STACK, NOINIT, READWRITE, ALIGN=3
StackMem
               SPACE               Stack
__initial_sp

After the initialization, I start with an RTOS kernel configuration and create some threads.
The configuration contains again a default stack size declaration, i.e each thread and the kernel itself occupy some stack size.

How is the RTOS default stack size related to the system stack size?

Does the RTOS configuration overwrite the stack size initialization in the startup file?

What occurs when the RTOS and overall thread stack size is larger than the system stack size in the startup file?

I am asking in general, independently of the RTOS product (it could be freeRTOS, TI-RTOS or any other kernel), because I assume the concept of all the kernels might be similar or even the same.

Thanks in advance for the support.

  • Hello Alejandro,

    So this isn't a huge area of expertise for me, but I will try and answer what I can for you and I will need a bit more information to help with some of this too.

    For starters, you can look at Sections 3.5.3, 3.6.3, and 7.5 of the SYS/BIOS User's Guide for some initial information: https://www.ti.com/lit/ug/spruex3v/spruex3v.pdf

    That should help with the questions about RTOS stack vs System Stack.

    When you talk about 

    I'm using the default startup file from TI, which declares and initializes the system stack size as follows (excerpt):

    Can you clarify which file you are working with? Is it something that is part of the RTOS package? Can you point out where I can find it to look over it? I'm just not familiar with that.

    In general my understanding on the surface is that if you change the stack size using the .cfg file with the XGCONF tool then those changes should apply to any startup files, but in a default RTOS project I'm not seeing a specific startup file to verify that with.

    Best Regards,

    Ralph Jacobi

  • Hello Alejandro,

    How is the RTOS default stack size related to the system stack size?

    Does the RTOS configuration overwrite the stack size initialization in the startup file?

    I can confirm that when I adjust the RTOS configuration in the .cfg file using XGCONF, the changes are reflected in the compiled code. That is how I would recommend you increase the stack size for your application.

    Best Regards,

    Ralph Jacobi