EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Stack size

Started by Jakub Szumacher January 7, 2010
In CrossStudio for ARM we have many stacks fields to configure:

"
Stack Size (fiq mode)
Stack Size (irq mode)
....
Stack Size (user/system mode)
"

What is function of anyone of them (where are differences)?

I'm trying to use less memory in CPU so i want reduce stack size - how to do it safty?

How to check how many amount of memory stack realy needs?

How to optymize stack size?
best regards
Jakub

An Engineer's Guide to the LPC2100 Series

Jakub

> "
> Stack Size (fiq mode)
> Stack Size (irq mode)
> ....
> Stack Size (user/system mode)
> "
>
> What is function of anyone of them (where are differences)?

ARM CPUs (except CM3) have different modes, each of them has its own stack
(check ARM reference manual)

> I'm trying to use less memory in CPU so i want reduce stack size - how to do it safty?

Abort stacks can often combined.

> How to check how many amount of memory stack realy needs?

Fill it with a virgin pattern and check it after some time ...

> How to optymize stack size?

Trial'n'error, thinking and analyzing your code
--
42Bastian
+
| http://www.sciopta.com
| Fastest direct message passing kernel.
| IEC61508 certified.
+
Jakub Szumacher wrote:
> In CrossStudio for ARM we have many stacks fields to configure:
>
> "
> Stack Size (fiq mode)
> Stack Size (irq mode)
> ....
> Stack Size (user/system mode)
> "
>
> What is function of anyone of them (where are differences)?
These are not CrossWorks specific but specific to the ARM7. There is a
stack per mode that the CPU can be in. The modes are described in the
ARM ARM (ARM Architecture Reference Manual) which can be obtained from
ARM themselves.

It is likely that you will be using Supervisor, System and IRQ. If you
are not using the others then you don't need to set up a stack for them,
although it might be beneficial to do so while you are debugging.
Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers.
8000 Downloads in November.
Jakub,

----- Original Message -----
From: "42Bastian"
To:
Sent: Thursday, January 07, 2010 10:10 AM
Subject: Re: [lpc2000] Stack size
> Jakub
>
>> "
>> Stack Size (fiq mode)
>> Stack Size (irq mode)
>> ....
>> Stack Size (user/system mode)
>> "
>>
>> What is function of anyone of them (where are differences)?
>
> ARM CPUs (except CM3) have different modes, each of them has its own stack
> (check ARM reference manual)
>
>> I'm trying to use less memory in CPU so i want reduce stack size - how to do it safty?
>
> Abort stacks can often combined.
>
>> How to check how many amount of memory stack realy needs?
>
> Fill it with a virgin pattern and check it after some time ...
>

If you define INITIALIZE_STACKS in project property pages, the CrossWorks will fill them with 0xCC during startup, see crt0.s.

>> How to optymize stack size?
>
> Trial'n'error, thinking and analyzing your code
> --
> 42Bastian
> +
> | http://www.sciopta.com
> | Fastest direct message passing kernel.
> | IEC61508 certified.
> +
>

Jan


The 2024 Embedded Online Conference