[ECOS] Variable in uninitialized part of ram

Kurt Siedenburg kurt.siedenburg@vicom.com
Wed Dec 17 20:51:00 GMT 2008


Try replacing
   nvv_t nvv __attribute__ ((section ("sticky")));
with
   nvv_t nvv __attribute__ ((section (".sticky")));

i.e. add a dot before sticky.

Otherwise it looks quite similar to what I do to achieve this purpose.


-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Robert
Brusa
Sent: Wednesday, December 17, 2008 12:05 PM
To: ecos-discuss
Cc: Bob.Brusa@gmail.com
Subject: [ECOS] Variable in uninitialized part of ram

Hi
I am trying to put a variable into a separate segment of ram that will
not be initialized. I have tried a lot, but I always get errors from the
linker - errors I simply do not understand. Here is what I do:

In the source code I define the variable nvv of type nvv_t with the
statement:
nvv_t nvv __attribute__ ((section ("sticky")));		//non-volatile
position  
and mode/submode-info

In the linker file provided by eCOS I add two lines. The first one is:

     sram (!IW): ORIGIN = 0x0020FF00, LENGTH = 0x00100

It goes between ram and rom-defining lines of the region definitions
(MEMORY)

and the line
	.sticky ALIGN (0x4) : { *(.sticky) } > sram

goes into the SECTIONS - just following the .bss-line.

The linker then produces the following error-listing:
Building target: ifw
Invoking: GCC C Linker
arm-elf-gcc -nostartfiles -L/home/rwb/lw4/install/lib -Ttarget.ld
-mcpu=arm7tdmi -Wl,--gc-sections -Wl,-static -g -nostdlib -Xlinker -Map
-Xlinker ifw.map -o"ifw"  ./Alignment.o ./EEProm.o ./Log.o ./RPC.o
./ictrl.o ./ihw.o ./link.o ./motoren.o ./myastro.o ./novas1.o
./novascon.o ./rtc.o ./solsys3.o ./sun.o ./trackdefs.o ./util.o
/opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../
arm-elf/bin/ld:  
warning: no memory region specified for section `sticky'
/opt/ecos/gnutools/arm-elf/bin/../lib/gcc-lib/arm-elf/3.2.1/../../../../
arm-elf/bin/ld:  
address 0xc620 of ifw section .bss is not within region ram
collect2: ld returned 1 exit status
make: *** [ifw] Fehler 1

Please help.
    Robert

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list