How do I investigate the stack of a task to make sure there's enough space?
How do I investigate the stack of a task to make sure there's enough space?
I have a number of tasks each with an assigned stack, basically an arbitrary size, such as 8K, 16K etc. I would like to have a way to find out how their stacks are being used when they are making deep calls especially calls to library functions that I didn't write and don't know how they consume the stack. Is there a standard tool or library to make this happen? Thank you!
-
- Posts: 45
- Joined: Thu Aug 22, 2019 3:48 am
Re: How do I investigate the stack of a task to make sure there's enough space?
I assume you are referring to the some RTOS stack - most have a function you can call to tell you the maximum used to that point in the execution. You will need to refer to the documentation of the RTOS you are using.
Susan
Susan
Re: How do I investigate the stack of a task to make sure there's enough space?
Susan,
Thank you! So do you mean that RTOS keeps track of stack usage and I just have to call a function to return the max stack depth? Sounds very convenient! I'm used to programming microcontrollers without any type of operating system support. Maybe I should start chipping away at the RTOS doc.
Thank you! So do you mean that RTOS keeps track of stack usage and I just have to call a function to return the max stack depth? Sounds very convenient! I'm used to programming microcontrollers without any type of operating system support. Maybe I should start chipping away at the RTOS doc.
-
- Posts: 9617
- Joined: Thu Nov 26, 2015 4:08 am
Re: How do I investigate the stack of a task to make sure there's enough space?
Fwiw, you're probably looking for this.
Who is online
Users browsing this forum: warwound and 71 guests