Reply by Rachel Adamec●September 22, 20062006-09-22
>From: Kipton Moravec
>Subject: [msp430] Segments in IAR Assembler
>
>I am writing for a MSP430F2012. I am writing it mostly in C with the
>interrupts in assembler for the IAR Compiler
>
>Here is what I have:
> [snip]
>
>I get an error on the "RSEG interrupt_d :DATA" line.
>There is no error on the "RSEG interrupt_a :CODE" line.
>
>The message is:
>Fatal Error [e72] Segment interrupt_d must be defined in a segment
>definition option (-Z, -b, or -P).
>
I think (general disclaimers abound! it's too late on a Friday afternoon to
be held to any of this ;-)
as I was saying - I think your issue is your *.xcl file... this is the one that
defines the segments of memory... a typical 'c' file has a CODE
segment, but it has data segments defined as:
//segment address range max usage (assm option)
// size
//------- ------------- ---- -------------------
//UDATA0 0200-09FF 2 Kb Uninitialized variables
//IDATA0 0200-09FF 2 Kb Initialized variables
//CSTACK 0200-09FF 2 Kb Run-time stack/auto vars
//ECSTR 0200-09FF 2 Kb Writeable strng literals
and for the code segment:
//Program and non-volatile segments (FLASH)
//========================================//segment address range max size
usage (assembler option)
//------- ------------- -------- -------------------
//INFO 1000-10FF 256 bytes Information memory
//CODE 4000-FFDF <48 Kb Program code
//CONST 4000-FFDF <48 Kb Constant "const" vars
//CSTR 4000-FFDF <48 Kb String literals
//CDATA0 4000-FFDF <48 Kb Inits for IDATA0
//CCSTR 4000-FFDF <48 Kb Inits for ECSTR
//INTVEC FFE0-FFFF 32 bytes Interrupt vectors
(example is from MSP430F148C.xcl)
so, CODE is defined, but DATA isn't.
May not be the issue, but I've had to play a few games with these files
before...
Good Luck!
Rachel Adamec
Norristown, PA, USA
Reply by Kipton Moravec●September 22, 20062006-09-22
Thanks that was the hint I needed.
"RSEG interrupt_d :DATA"
had to be changed to:
"RSEG DATA16_N :DATA"
"RSEG interrupt_a :CODE"
had to be changed to:
"RSEG CODE :CODE"
Now it compiles and links. I looked at the linker output to get the
names. The names are different than what you have below.
Kip
On Fri, 2006-09-22 at 14:42 -0500, Rachel Adamec wrote: > >From: Kipton Moravec
> >Subject: [msp430] Segments in IAR Assembler
>
> >
> >I am writing for a MSP430F2012. I am writing it mostly in C with the
> >interrupts in assembler for the IAR Compiler
> >
> >Here is what I have:
> >
> [snip]
>
> >
> >I get an error on the "RSEG interrupt_d :DATA" line.
> >There is no error on the "RSEG interrupt_a :CODE" line.
> >
> >The message is:
> >Fatal Error [e72] Segment interrupt_d must be defined in a segment
> >definition option (-Z, -b, or -P).
> > I think (general disclaimers abound! it's too late on a Friday
> afternoon to be held to any of this ;-)
>
> as I was saying - I think your issue is your *.xcl file... this is the
> one that defines the segments of memory... a typical 'c' file has
a
> CODE segment, but it has data segments defined as:
>
> //segment address range max usage (assm option)
> // size
> //------- ------------- ---- -------------------
> //UDATA0 0200-09FF 2 Kb Uninitialized variables
> //IDATA0 0200-09FF 2 Kb Initialized variables
> //CSTACK 0200-09FF 2 Kb Run-time stack/auto vars
> //ECSTR 0200-09FF 2 Kb Writeable strng literals
>
> and for the code segment:
>
> //Program and non-volatile segments (FLASH)
> //========================================> //segment address range max size
usage (assembler option)
> //------- ------------- -------- -------------------
> //INFO 1000-10FF 256 bytes Information memory
> //CODE 4000-FFDF <48 Kb Program code
> //CONST 4000-FFDF <48 Kb Constant "const" vars
> //CSTR 4000-FFDF <48 Kb String literals
> //CDATA0 4000-FFDF <48 Kb Inits for IDATA0
> //CCSTR 4000-FFDF <48 Kb Inits for ECSTR
> //INTVEC FFE0-FFFF 32 bytes Interrupt vectors
>
> (example is from MSP430F148C.xcl)
> so, CODE is defined, but DATA isn't.
>
> May not be the issue, but I've had to play a few games with these
> files before...
>
> Good Luck!
>
> Rachel Adamec
> Norristown, PA, USA --
Kipton Moravec