| Author |
Message |
|
|
Posted: May 13, 2012 - 04:15 PM |
|

Joined: Apr 15, 2009
Posts: 13
Location: Vilnius, Lithuania
|
|
Hi,
I was using AVR studio 6 beta for programming atxmega128a1 with external 128kB SRAM. It was showing an error, due to memory overflow, but still built the project(until memory overflowed 64kB). I could initialize variables in section .data=0x4000 ( in avr studio 5.0 I also could initialize in section .data=0x804000, but not in 5.1 or 6.0 and I don't know why)...When downloading Studio 6.0 with service pack 1 I was expecting that in GCC it will be expanded pointer addresses to 24bit and I could use all 128kB for variables, but after two hours I gave up and realised, that I couldn't use any external memory... Please help. Thank You. |
|
|
| |
|
|
|
|
|
Posted: May 26, 2012 - 08:18 PM |
|

Joined: Apr 15, 2009
Posts: 13
Location: Vilnius, Lithuania
|
|
Any suggestions?  |
|
|
| |
|
|
|
|
|
Posted: May 26, 2012 - 08:55 PM |
|


Joined: Jul 18, 2005
Posts: 62324
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
|
Quote:
I was expecting that in GCC it will be expanded pointer addresses to 24bit and I could use all 128kB for variables,
You don't get that until 4.7 but AS6 currently has 4.6
Show the exact mechanism you are using to try and specify the .data base address. |
_________________
|
| |
|
|
|
|
|
Posted: May 27, 2012 - 05:27 PM |
|

Joined: Apr 15, 2009
Posts: 13
Location: Vilnius, Lithuania
|
|
Thanks for Your reply.
I'm just writing into data segment space (project->properties->Toolchain->Linker->Memory settings):
.data=0x4000
as far as I understand .data segment starts at 0x800000 and .eeprom segment starts at 0x810000, so when I write 0x4000 ( or tried 0x2000) I think, that linker is putting my variables to segment .data=0x804000. But this segment is very limited, because eeprom is very close to it->0x810000.
I was trying other methods, using other segments, as example:
volatile unsigned int Data1[16000] __attribute__ ((section (".ext")))
and writing external segment address in the same space where put .data adress .ext=0xD000, but nothing worked. AS6 is even worse than AS5, AS51 or AS6 beta in this external memory thing, because when compiling I get an error, that my memory is overflowed, but in older versions it was compiling just with warning about memory space...
Thank you for help. |
|
|
| |
|
|
|
|
|
Posted: May 27, 2012 - 05:36 PM |
|

Joined: Apr 15, 2009
Posts: 13
Location: Vilnius, Lithuania
|
|
| I read a bit about GCC 4.7 and downloaded from sourceforge, but didn't understand how to use it...just unzipped and replaced old files with new ones, but nothing worked... |
|
|
| |
|
|
|
|
|
Posted: May 29, 2012 - 07:13 PM |
|


Joined: Jul 18, 2005
Posts: 62324
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
| GCC uses 0x80???? as a prefix for RAM. If you use just 0x40000 it will be taken as an address in code flash. |
_________________
|
| |
|
|
|
|
|
Posted: May 29, 2012 - 08:44 PM |
|

Joined: Apr 15, 2009
Posts: 13
Location: Vilnius, Lithuania
|
|
Because of 0x80, I was surprised and amazed, because datasheet tells different...But I have checked .map file and saw:
Name Origin Length
text 0x00000000 0x00100000
data 0x00802000 0x0000ffa0
eeprom 0x00810000 0x00010000
fuse 0x00820000 0x00000400
lock 0x00830000 0x00000400
signature 0x00840000 0x00000400
Sorry, I'm using 0x2000(not 0x4000), because I was using full address 0x804000 in old avr studio 5 and forgot that new atmel studio 6 uses this external memory thing in different way. For now I'm just using my functions made from:
hugemem_read16(0xD000+(base<<1))
and writing the same way, but it would be much more easier to use variables... |
|
|
| |
|
|
|
|
|