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.

RTOS/EK-TM4C1294XL: RTOS/EK-TM4C1294XL

Part Number: EK-TM4C1294XL

Tool/software: TI-RTOS

After running gpiointerrupt_EK_TM4C1294XL_TI project, the Task in ROV remains the same values 124 for both stackPeak from entering main to BIOS_start(); even though I add a add1(int x) with a 100 int array function in this program. 

1. What happens for ROV?  where is add1 go?  system stack or task stack?  .

2. Where do gpioButtonFxn0(unsigned int index)  and gpioButtonFxn1(unsigned int index) go, system stack or task stack?  since they are callback during the interrupt

Thanks, 

int add1(int x)
{

int array0 [100] = 0;

return ++x;
}

  • Hi Neil,

      Your add1 is not a task or something that is called by either the UARTMonTask or the Idle task and therefore the peak stack usage for these two tasks does not reflect the your function add1. 

      If you want to learn how to use task and see how the stackPeak changes I will suggest you start with the Task Mutex Example. This example creates two tasks. See below.

      If I use ROV to show the peak stack usage I will see 280 and 260 for both the task1 and task2. 

    Now I modify the task2 slightly and inserted the line int array0 [10] = 0 inside task2Fxn and I will see 300 as the stackPeak. This makes sense because I initialize an integer array of 10 elements. The 10 32-bit words takes up 40 bytes. What I had was 260 and now is 300 which is exactly what you would expect.

  • Thank you, Charles, for this example.  I am trying this example and will get back to you if I have a question about it.

  • Hi, Charles, but the add1() is in main(), so it will affect the stackPeak in the task main().  Where is the main() task in VOR?

  • I guess what you can try is to see how the stack is affected in the Idle task. When task1 and task2 are not run then the default Idle task is run. You can try try below to see how the stack size change in the Idle task. 

  • Thank you, Charles, I will definitely try it, but is Idle running in an independent thread or in main() thread?

  • Idle is an independent thread but of lowest priority. I'm not too sure what you meant by main() thread. After the BIOS_Start() is call, it starts the BIOS scheduler. There is no "main" thread after the BIOS started. Nothing is running yet, so BIOS always defaults to the lowest priority thread – Idle. If there are functions listed in the Idle thread (i.e. add1), they will begin executing. This is similar to any functions running inside a standard while(1) loop in main() – waiting for “something” to happen – like an interrupt.