FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2015 Threads] Measuring Stack UsagePosted by razed11 on November 13, 2015 The two stack checking techniques do not meet my needs (assuming I understand them). I'd like to profile my stacks and then adjust them to have a certain amount of margin. If I knew where a task stack begins, its size (the same in our application), and a known pattern is written to them then I can download the memory and analyze it after exercising the system rather than compute anything at run-time.
Any suggested approaches?
Thanks.
Measuring Stack UsagePosted by rtel on November 13, 2015 This is something that is intended for the next release: http://sourceforge.net/p/freertos/feature-requests/95/ not that that helps you immediately.
When a stack is created it is filled with 0xa5 - so there is already a known pattern in the stack.
There is also a function that will return the maximum amount of stack that has ever been consumed since the task was created: http://www.freertos.org/uxTaskGetStackHighWaterMark.html
The pxStack member of the task control block points to the start of a task's stack. Due to our strict data hiding policy, you cannot access TCB members directly, but you can view them in the debugger. For example, to view the start of the stack for the currently running task you can view pxCurrentTCB->pxStack. Some debuggers will require a case as follows ( ( tskTCB * ) pxCurrentTCB )->pxStack.
Regards.
Measuring Stack UsagePosted by xz8987f on November 13, 2015 If you are using GNU tools, there is an approach to measure the amount of stack used, see http://mcuoneclipse.com/2015/08/21/gnu-static-stack-usage-analysis/.
Measuring Stack UsagePosted by razed11 on November 13, 2015 This is great news. FreeRTOS is on our roadmap for many products to come so we can take advantage of the new feature during the next availalbe product cycle (which happens several times a year for us).
I'm fine with using the debugger. I'm just trying to add stack checking to our checklist for milestones. With 7.0.2 does it fill the stack with the pattern? Can you suggest a modification (to save me time hunting through the source). A product shipping soon has this version. We've moved to 8.X for following products.
Thanks,
Kenny
Measuring Stack UsagePosted by razed11 on November 13, 2015 Erich: Thank you. Nice write up! We are using GNU and Eclipse for a Cortex-A9 which I am a little new to (IAR for many years before) so I am still learning some of the tricks. I'll try it right now.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|