hi,
atmega32 + mikrobasicavr
when i declare this
dim buftemp as byte[1024]
i have a error message follow
0:0 E-0 Linker error: Not enough RAM
when i use const buftemp as byte[1024] = (0,0,0, ....)
it work but i can't modify buftemp because is a constante
what is it ?
this provide from atmega32 ?
thanks for your response
0:0 E-0 Linker error: Not enough RAM, what is it ?
0:0 E-0 Linker error: Not enough RAM, what is it ?
Last edited by emule on 23 Aug 2008 21:36, edited 1 time in total.
-
- Posts: 41
- Joined: 31 Jan 2008 14:27
It appears that you have declared enough variables which have already consumed over 1024 bytes of the Mega32 RAM - there is 2048 bytes available. (Unless you have external SRAM on your board.)
Some of that 2048 bytes is used for stacks and the compiler run-time support, leaving less that 2048 bytes available for your use.
I just created a very simple program;
program ArrayTest
dim buftemp as byte[1024]
dim data, i as word
main:
for i=0 to 1023
buftemp=00
next i
end.
Once compiled the compiler reported that 1154 bytes of SRAM were used and that there are 477 bytes available for use. That equates to 2048 - 1154 - 477 = 417 bytes used for stacks and run-time support.
Or stated another way; I have a total of 1631 bytes available for my program to use. That will likely change on a case by case basis when calling subroutines, library functions, etc.
Some of that 2048 bytes is used for stacks and the compiler run-time support, leaving less that 2048 bytes available for your use.
I just created a very simple program;
program ArrayTest
dim buftemp as byte[1024]
dim data, i as word
main:
for i=0 to 1023
buftemp=00
next i
end.
Once compiled the compiler reported that 1154 bytes of SRAM were used and that there are 477 bytes available for use. That equates to 2048 - 1154 - 477 = 417 bytes used for stacks and run-time support.
Or stated another way; I have a total of 1631 bytes available for my program to use. That will likely change on a case by case basis when calling subroutines, library functions, etc.
-
- Posts: 41
- Joined: 31 Jan 2008 14:27