EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Re: Constants in INFO memory with Crossworks

Started by Nico Bollen April 5, 2008
Hi,
I'm using Crossworks with the MSP430F235.
In this chip the Info Memory is devided in 4 segments which are
named: INFO_A,INFO_B,INFO_C,INFO_D
I've checked this in the section_placement.xml file.
Now I'm able to fill the memory but I still have to use the
constants in my code once so they are initialised.
But it seems that there is a problem with the size of these
segments, in hardware the segments are 64 bytes, this can also be
seen in the section placement file, but now when I'm filling the
info mem it seems that when I put more than 63 bytes in the segment
there is an overflow and the compiler starts to fill the memory from
address 0x00000
Any tips or ideas?

Thanks,
Nico

--- In m..., "microbit" wrote:
>
> Hi Nico,
>
> Your main problem is that your syntax is wrong to return to
default placement :
> #pragma default should be :
>
> #pragma constseg(default)
>
> You'll be getting overflows on your segs !!!
>
> Apart from that, just use an existing segment such as INFO, INFO A
or INFO B.
> Although the constseg pragma is to create new segments, AFAIK it
works fine for existing segments.
> Have a look in docs & in your Fxxx.xml file under \targets\
>
> Also, use the Symbol Browser to see "what's linked where", it's
there for as good reason !!
>
> If you're not sure, highlight #pragma and press F1, it's all
explained there...
>
> Best Regards,
> Kris
>
> -----Original Message-----
> From: m... [mailto:m...] On
Behalf Of Nico Bollen
> Sent: Saturday, 5 April 2008 8:46 PM
> To: m...
> Subject: [msp430] Re: Constants in INFO memory with Crossworks
>
> OK,
> It seems that you have to use the variable somewhere in code
before
> Crossworks will declare it, otherwise it is discarted and this way
I
> was not able to view data in the Info Memory.
> Any idea how to eliminate this?
> I'm just trying to initialise the Info Memory which afterwards is
> entered in another way...
> Thanks
>
> --- In m..., "Nico Bollen" wrote:
> >
> > Thanks,
> > I've changed it to:
> >
> > #pragma constseg("INFO_D")
> > const unsigned char Test[] > > {
> > 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A
> > };
> > #pragma default
> >
> > but it is still not working...
> >
> >
> >
> > --- In m..., "Paul Curtis" wrote:
> > >
> > > 0x1000 is not a section name.
> > >
> > > > -----Original Message-----
> > > > From: m... [mailto:m...]
> On
> > Behalf
> > > > Of Nico Bollen
> > > > Sent: 05 April 2008 09:47
> > > > To: m...
> > > > Subject: [msp430] Constants in INFO memory with Crossworks
> > > >
> > > > Dear all,
> > > > I'm trying to put some constants in INFO memory as follows
but
> it
> > > > seems that it is not working well:
> > > >
> > > > #pragma constseg("0x1000")
> > > > const unsigned char Test[] > > > > {
> > > > 0xFE,
> > > > 0xFE,
> > > > 0x01
> > > > };
> > > > #pragma default
> > > >
> > > > Any ideas, tips?
> > > > I'm using Rowley Crossworks...
> > > >
> > > > Best regards,
> > > > Nico
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >

Beginning Microcontrollers with the MSP430

You have to look in the specific MCU target file.
I don't know about F235, but you will see that apart from INFO A/B(C/D) there is also a section
called INFO. This one overlays the other A...B/D
Just use section INFO instead and that should give you 256 bytes.

#pragma constseg("INFO") // covers the entire INFO memory

Best Regards,
Kris

-----Original Message-----
From: m... [mailto:m...] On Behalf Of Nico Bollen
Sent: Saturday, 5 April 2008 9:57 PM
To: m...
Subject: [msp430] Re: Constants in INFO memory with Crossworks

Hi,
I'm using Crossworks with the MSP430F235.
In this chip the Info Memory is devided in 4 segments which are
named: INFO_A,INFO_B,INFO_C,INFO_D
I've checked this in the section_placement.xml file.
Now I'm able to fill the memory but I still have to use the
constants in my code once so they are initialised.
But it seems that there is a problem with the size of these
segments, in hardware the segments are 64 bytes, this can also be
seen in the section placement file, but now when I'm filling the
info mem it seems that when I put more than 63 bytes in the segment
there is an overflow and the compiler starts to fill the memory from
address 0x00000
Any tips or ideas?

Thanks,
Nico

--- In m..., "microbit" wrote:
>
> Hi Nico,
>
> Your main problem is that your syntax is wrong to return to
default placement :
> #pragma default should be :
>
> #pragma constseg(default)
>
> You'll be getting overflows on your segs !!!
>
> Apart from that, just use an existing segment such as INFO, INFO A
or INFO B.
> Although the constseg pragma is to create new segments, AFAIK it
works fine for existing segments.
> Have a look in docs & in your Fxxx.xml file under \targets\
>
> Also, use the Symbol Browser to see "what's linked where", it's
there for as good reason !!
>
> If you're not sure, highlight #pragma and press F1, it's all
explained there...
>
> Best Regards,
> Kris
>
> -----Original Message-----
> From: m... [mailto:m...] On
Behalf Of Nico Bollen
> Sent: Saturday, 5 April 2008 8:46 PM
> To: m...
> Subject: [msp430] Re: Constants in INFO memory with Crossworks
>
> OK,
> It seems that you have to use the variable somewhere in code
before
> Crossworks will declare it, otherwise it is discarted and this way
I
> was not able to view data in the Info Memory.
> Any idea how to eliminate this?
> I'm just trying to initialise the Info Memory which afterwards is
> entered in another way...
> Thanks
>
> --- In m..., "Nico Bollen" wrote:
> >
> > Thanks,
> > I've changed it to:
> >
> > #pragma constseg("INFO_D")
> > const unsigned char Test[] > > {
> > 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A
> > };
> > #pragma default
> >
> > but it is still not working...
> >
> >
> >
> > --- In m..., "Paul Curtis" wrote:
> > >
> > > 0x1000 is not a section name.
> > >
> > > > -----Original Message-----
> > > > From: m... [mailto:m...]
> On
> > Behalf
> > > > Of Nico Bollen
> > > > Sent: 05 April 2008 09:47
> > > > To: m...
> > > > Subject: [msp430] Constants in INFO memory with Crossworks
> > > >
> > > > Dear all,
> > > > I'm trying to put some constants in INFO memory as follows
but
> it
> > > > seems that it is not working well:
> > > >
> > > > #pragma constseg("0x1000")
> > > > const unsigned char Test[] > > > > {
> > > > 0xFE,
> > > > 0xFE,
> > > > 0x01
> > > > };
> > > > #pragma default
> > > >
> > > > Any ideas, tips?
> > > > I'm using Rowley Crossworks...
> > > >
> > > > Best regards,
> > > > Nico
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >

The 2024 Embedded Online Conference