* [ECOS] Variable in uninitialized part of ram
@ 2008-12-17 20:40 Robert Brusa
2008-12-17 20:51 ` Kurt Siedenburg
0 siblings, 1 reply; 3+ messages in thread
From: Robert Brusa @ 2008-12-17 20:40 UTC (permalink / raw)
To: ecos-discuss; +Cc: Bob.Brusa
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [ECOS] Variable in uninitialized part of ram
2008-12-17 20:40 [ECOS] Variable in uninitialized part of ram Robert Brusa
@ 2008-12-17 20:51 ` Kurt Siedenburg
2008-12-18 4:14 ` Robert Brusa
0 siblings, 1 reply; 3+ messages in thread
From: Kurt Siedenburg @ 2008-12-17 20:51 UTC (permalink / raw)
To: Bob.Brusa, ecos-discuss
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-17 20:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-17 20:40 [ECOS] Variable in uninitialized part of ram Robert Brusa
2008-12-17 20:51 ` Kurt Siedenburg
2008-12-18 4:14 ` Robert Brusa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).