EmbeddedRelated.com
Forums

Hi all, Stack overflow

Started by Bobby Baskar October 15, 2009
Dear All,
Can anyone help me in solving this problem in IAR compiler.

The stack 'Stack' is filled to 92% (74 bytes used out of 80). The warning threshold is set to 90%

Have a nice day.

Bobby
Now, send attachments up to 25MB with Yahoo! India Mail. Learn how. http://in.overview.mail.yahoo.com/photos



Beginning Microcontrollers with the MSP430

First, it is not necessary a problem, it's just a warning as it hasn't overflowed yet. You need to know what the stack is and how it is used to understand what the warning means and if you need to do something about it and what that would be.

But to answer your question:
You have a bucket. You have someone watching it. He gives you a warning when it's 90 percent full.
The watcher is sending you a warning because it is 92% full. What do you do if you don't want him to give you a warning?
Either increase the stack size (override the default 80 bytes), increment the treshold (or shut him up) or decrease the stack usage. You can do the latter by moving local variables to global ones, using smaller variables like chars instead of ints where allowed, or reduce function call nesting. Each time you call a function, local variables from the CALLING function are pushed into the stack. IAR has a very useful option where you can see which functions are presently on the stack (you can see the stack 'tree'). Don't remember where it is. Maybe View -> Stack?

Anyway, you first need to learn what the stack is.

Regards,
Michael K.

--- In m..., Bobby Baskar wrote:
>
> Dear All,
> Can anyone help me in solving this problem in IAR compiler.
>
> The stack 'Stack' is filled to 92% (74 bytes used out of 80). The warning threshold is set to 90%
>
> Have a nice day.
>
> Bobby
>
>
> Now, send attachments up to 25MB with Yahoo! India Mail. Learn how. http://in.overview.mail.yahoo.com/photos
>
>
>

Please don't set any limit the stack. Set it to auto.

Regards,
Jitendra

From: m... [mailto:m...] On Behalf Of Bobby Baskar
Sent: Thursday, October 15, 2009 12:32 PM
To: m...
Subject: [msp430] Hi all, Stack overflow

Dear All,
Can anyone help me in solving this problem in IAR compiler.

The stack 'Stack' is filled to 92% (74 bytes used out of 80). The warning threshold is set to 90%

Have a nice day.

Bobby

Now, send attachments up to 25MB with Yahoo! India Mail. Learn how. http://in.overview.mail.yahoo.com/photos


DISCLAIMER:
-----------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------


Is there a way to set it to auto? Mine just says choose a number between 0 and 65535.

--- In m..., "Jitendra Chauhan, Noida" wrote:
> Please don't set any limit the stack. Set it to auto.
>
> Regards,
> Jitendra
>
> From: m... [mailto:m...] On Behalf Of Bobby Baskar
> Sent: Thursday, October 15, 2009 12:32 PM
> To: m...
> Subject: [msp430] Hi all, Stack overflow
>
> Dear All,
> Can anyone help me in solving this problem in IAR compiler.
>
> The stack 'Stack' is filled to 92% (74 bytes used out of 80). The warning threshold is set to 90%
>
> Have a nice day.
>
> Bobby
>
> Now, send attachments up to 25MB with Yahoo! India Mail. Learn how. http://in.overview.mail.yahoo.com/photos
>
>
> DISCLAIMER:
> -----------
>
> The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
> It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
> this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
> Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
> this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
> received this email in error please delete it and notify the sender immediately. Before opening any mail and
> attachments please check them for viruses and defect.
>
> -----------
>
>