[En-Nut-Discussion] How to incorporate additional linker flags into nutconf's

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Wed Feb 4 19:33:25 CET 2009


Hello,

has the proposed way to incorporate additional linker flags changed since
the discussion in 2005:

"How to incorporate the linker flag -Wl,-Tdata=0x801100 into nutconf"

Harald explained:
: >* How to incorporate the linker flag -Wl,-Tdata=0x801100 into 
: > nutconf's build model. All apps compiled for the AT90CAN128 
: > require relocation of 
: >.data/.bss into the external RAM.

: Well, hum... complicated stuff. For several times I tried to
: implement a more consistent configuration for compiler/linker
: options, but every time I got stuck somewhere. If you want to
: do it in short time
: 
: a) Create new Make*.avr-xgcc files and update nutsetup.
: (nutconf will detect them automatically)
: 
: b) or implement a new Makefile macro for additional
: linker options. In this case, nutsetup and the Lua scripts
: have to be modified.
: 
: I assume that option a) can be done easily. Option b) is much
: better and has the potential to expand to fully configurable
: compile options. But that's where I got stuck in the past.

My programm should run on boards with and without external RAM. Some
hardware detection is done, and external RAM is only accessed when 
it is really there. 
I define the variables in external RAM like:
volatile unsigned long int nco_r[4]  __attribute__ ((section (".aram")));
and give the additional linker flag
 -Wl,--section-start=.aram=0x801100 
and I also have adapted the linker script. 

By placing the variables like:
volatile unsigned char * alu_ctl= (unsigned char *)      0xe000;
I think, I need additional RAM on the heap from builtin ram to hold the
pointer and need more memory access.

Bye
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------


More information about the En-Nut-Discussion mailing list