SV: [Icc-avr] Using to much RAM for local variables
Johan Wallström
johan at edab.nu
Fri Aug 15 03:55:50 PDT 2008
Yes one global array is the best way to do it, and track the usage of it
carefully
Bengt Ragnemalm skrev:
> OK, so it is normal. Just needed to know.
>
> Johannes, what do you mean with "always global"? I have need for a
> temporary 512 bytes, what good is it to make this into something permanent?
> But if it is so tricky to track problems with to large temporary RAM
> variables (I do use Stack Check) maybe it is better to define one global
> array and switch the usage of it.
>
> /Bengt
>
>
>> -----Ursprungligt meddelande-----
>> Från: icc-avr-bounces at imagecraft.com [mailto:icc-avr-
>> bounces at imagecraft.com] För Richard Man
>> Skickat: den 15 augusti 2008 10:45
>> Till: benra at imt.liu.se; icc-avr at imagecraft.com
>> Ämne: Re: [Icc-avr] Using to much RAM for local variables
>>
>> There are billions problems to solve to write a compiler product.
>> Most are easy, some are very difficult. Solving a SPECIFIC instance
>> of a problem is easy, but solving a generic problem is never. To
>> answer your questions directly, yes, it can be solved, especially by
>> linker who does full call tree analysis and then layout all the SRAM
>> requirements, and that'd be the right way to solve it. Unfortunately,
>> that is not easy.
>>
>> It is the same as requesting Atmel to add a "stack check"
>> hardware. All they need is a data break register. How hard can *that* be?
>>
>> At 12:25 AM 8/15/2008, Bengt Ragnemalm wrote:
>>
>>> Hi.
>>>
>>> I felled in a new pit and have just found the ladder.
>>>
>>> I use an Mega88, it has 1 k RAM. I have declared two local arrays,
>>> both with 512 bytes. Obviously this will not work if they are used
>>> simultaneously. Unfortunately they are, something I totally missed.
>>> But the code compiles fine and I have been a little upset struggling
>>> with the problem that my hardware just turned off after 90 seconds
>>> by it self without ever entering the POWER OFF state. The problem
>>> was that as soon as one of the arrays was starting to write data to
>>> the later sections, it instead was writing in my registers. Among
>>> others, the register that was controlling the power.
>>>
>>> QUESTION: Is it natural that the compiler does not generate any
>>> error in this situation?
>>>
>>> The actual problem should not be to difficult to solve.
>>>
>>>
>> // richard (This email is for mailing lists. To reach me directly,
>> please use richard at imagecraft.com)
>>
>> _______________________________________________
>> Icc-avr mailing list
>> Icc-avr at imagecraft.com
>> http://dragonsgate.net/mailman/listinfo/icc-avr
>>
>
>
> _______________________________________________
> Icc-avr mailing list
> Icc-avr at imagecraft.com
> http://dragonsgate.net/mailman/listinfo/icc-avr
>
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.138 / Virus Database: 270.6.3/1612 - Release Date: 2008-08-14 18:03
>
>
>
>
More information about the Icc-avr
mailing list