EmbeddedRelated.com
Forums

Extended memory in the f2618

Started by Thomas Montroy February 7, 2008
hi All,

I am trying to place some const data in the extended memory (__data20 after
address 0x10000) of the msp430f2618. I'm using modified linker file with the
command

-Z(CONST)DATA20_ID100-FFBD
-Z(CONST)DATA20_C000-1FFFF

Here is my test code:

#include
#include
int __data20 t1 = 7;
const __data20 t2 = 0xff;
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;

printf("%d %d\n",t1,t2);

while(1);

}
If I let the const __data20 memory be placed before address 0xFFFF, things
work fine, but if I force the variable t2 to be after 0x10000, I get that
t2=0.
t2 is placed at 0x10000 and when I look at the dissasembly, I see 0x00
there.

For the record, I'm using the medium data model and no optimization.

Am I just missing something simple? It seems like this should work.

-Tom

Beginning Microcontrollers with the MSP430

Without looking further into it, there are some errors on your statements:
The datasheet specifies "extended memory" to be addresses 0x030FF
through 0x01900.
Address 0x10000 through 0x1FFFF are part of the "Main:code memory".
Address 3100-FFBD are also part of the Code Memory.
Look at page 17 of http://focus.ti.com/lit/ds/symlink/msp430f2618.pdf

Just an idea:
The easiest explanation would be that those memory locatios are being
addressed by a 16 bit register, thus 0x10000 becomes 0x0000 (the
address of IE1 register, whose value after POR is 0). Anything up to
0xFFFF stays the same.

Maybe you're not using __data20 correctly? Which compiler ar you using?

Michael K.

--- In m..., "Thomas Montroy" wrote:
>
> hi All,
>
> I am trying to place some const data in the extended memory
(__data20 after
> address 0x10000) of the msp430f2618. I'm using modified linker file
with the
> command
>
> -Z(CONST)DATA20_ID100-FFBD
> -Z(CONST)DATA20_C000-1FFFF
>
> Here is my test code:
>
> #include
> #include
> int __data20 t1 = 7;
> const __data20 t2 = 0xff;
> void main(void)
> {
> WDTCTL = WDTPW + WDTHOLD;
>
> printf("%d %d\n",t1,t2);
>
> while(1);
>
> }
> If I let the const __data20 memory be placed before address 0xFFFF,
things
> work fine, but if I force the variable t2 to be after 0x10000, I get
that
> t2=0.
> t2 is placed at 0x10000 and when I look at the dissasembly, I see 0x00
> there.
>
> For the record, I'm using the medium data model and no optimization.
>
> Am I just missing something simple? It seems like this should work.
>
> -Tom
>
>
Sorry about the confusion. I did misstate the the type of memory. I meant
that trying to place const data in the code memory in the address range
0x10000 to 0x1FFFF.

I'm using the compiler IAR 4.10a. It's very likely that I am misusing the
_data20, but I'm not really sure how.
Earlier version of IAR used the small data model only which definitely made
use of upper addresses much more complicated. I had thought that the
v4.10would handle this stuff more easily provided that you use the
medium or
large data model.

-Tom

On Feb 7, 2008 9:53 AM, tintronic wrote:

> Without looking further into it, there are some errors on your
> statements:
> The datasheet specifies "extended memory" to be addresses 0x030FF
> through 0x01900.
> Address 0x10000 through 0x1FFFF are part of the "Main:code memory".
> Address 3100-FFBD are also part of the Code Memory.
> Look at page 17 of http://focus.ti.com/lit/ds/symlink/msp430f2618.pdf
>
> Just an idea:
> The easiest explanation would be that those memory locatios are being
> addressed by a 16 bit register, thus 0x10000 becomes 0x0000 (the
> address of IE1 register, whose value after POR is 0). Anything up to
> 0xFFFF stays the same.
>
> Maybe you're not using __data20 correctly? Which compiler ar you using?
>
> Michael K.
> --- In m... , "Thomas Montroy"
> wrote:
> >
> > hi All,
> >
> > I am trying to place some const data in the extended memory
> (__data20 after
> > address 0x10000) of the msp430f2618. I'm using modified linker file
> with the
> > command
> >
> > -Z(CONST)DATA20_ID100-FFBD
> > -Z(CONST)DATA20_C000-1FFFF
> >
> > Here is my test code:
> >
> > #include
> > #include
> >
> >
> > int __data20 t1 = 7;
> > const __data20 t2 = 0xff;
> > void main(void)
> > {
> > WDTCTL = WDTPW + WDTHOLD;
> >
> > printf("%d %d\n",t1,t2);
> >
> > while(1);
> >
> > }
> >
> >
> > If I let the const __data20 memory be placed before address 0xFFFF,
> things
> > work fine, but if I force the variable t2 to be after 0x10000, I get
> that
> > t2=0.
> > t2 is placed at 0x10000 and when I look at the dissasembly, I see 0x00
> > there.
> >
> > For the record, I'm using the medium data model and no optimization.
> >
> > Am I just missing something simple? It seems like this should work.
> >
> > -Tom
> >
> >
> >
> >
>