avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] avr-size .bss bigger than RAM?


From: Stuart Longland
Subject: Re: [avr-chat] avr-size .bss bigger than RAM?
Date: Wed, 26 Jul 2017 09:41:52 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

On 26/07/17 08:43, address@hidden wrote:
> I'm not sure that you can determine how big the stack is (nor can you 
> constrain it). In the AVR, the stack grows unconstrained downwards from the 
> top of RAM. See here: http://www.nongnu.org/avr-libc/user-manual/malloc.html 
> for an explanation of the memory sections in the AVR.
> 
> If you're running an RTOS you can often allocate/specify where the stacks for 
> each process reside, and how big they are, but you can't actually constrain 
> them to always fit within that space so you have to be careful to allocate 
> enough space for them. 

Agreed, you can't constrain it directly, but you can estimate how big
it'll get by the depth of subroutine calls and ISRs, then reserve that
portion of RAM so that stack and application state do not meet.

In my case, I'm not running an RTOS due to the severe memory
restrictions present in the ATTiny861.
-- 
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]