Hi all:
I am running winavr 2006*, on an atmega128 with 32k of XRAM mapped to
0x8000->0xFFFF. I would like the .bss memory section to be
allocated by
the linker in the internal RAM, while I'd like the .data section
and the
__malloc_heap_start to both be in XRAM. .bss being in IRAM is not
really
negotiable, and I'd much prefer .data to live in XRAM, due to the
larger
size of that section.
Unfortunately, the makefile I'm using doesn't seem to want to allocate
the __malloc_heap_start variable to the __data_end.
I've tried adding the following options, with no success:
LDFLAGS += -Wl,--section-start,.bss=0x800100 \
-Wl,--section-start,.data=0x808000) \
-Wl,--defsym,__heap_start=__data_end \
-Wl,--defsym,__heap_end=0x80FFFF \
The problem I have is that any memory I allocate with malloc ends
up in
the internal RAM, straight after .bss.
However, if I hard-code the __heap_start variable (to, say,
0x809000), I
have no problems - the malloc'ed memory is allocated in XRAM. This
is a
less than ideal situation, obviously, however I don't seem to be
able to
pass through the __data_end variable into the __heap_start (and
onwards
to __malloc_heap_start).
Anyone run into this before, and/or any suggestions??