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 2008 Threads] Stack usage in a taskPosted by Willem on November 9, 2008 What is the best way to determine how many stack I need to assign to a task?
RE: Stack usage in a taskPosted by MEdwards on November 9, 2008 Well you could try calculating it [max function call depth + plus max interrupt nesting depth + etc] but really trial and error is the best way. Start at [configMINIMAL_STACK_SIZE * 2], let the task run for a bit, then inspect the high water mark using http://www.freertos.org/uxTaskGetStackHighWaterMark.html and adjust as fit.
If the task does not get that far use http://www.freertos.org/Stacks-and-stack-overflow-checking.html to trap errors.
The new MPLAB and Eclipse plugins make this easier as they display the high water mark.
RE: Stack usage in a taskPosted by Willem on November 9, 2008 Ah, didn't know that kind of (powerfull) tools.
How about the plugin? I have the latest version (not beta) of MPlab.
RE: Stack usage in a taskPosted by Willem on November 9, 2008 *just curious, how big is the minimal_stack_size ? I mean, how many stacks can it contain?
RE: Stack usage in a taskPosted by MEdwards on November 9, 2008 It is sized so the idle task can run without crashing, but how big that has to be depends on the architecture. The idle task does not do anything so only requires a small stack.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|