Hi Frederic,

If you declare data with the const attribute it goes in the same place as the code. Is that what you want to know, or are you looking to force the const data into a very specific area of flash? That is also possible by using an attribute, and modifying the default linker file to define another segment in the required area. For example, I have a 16K device, in which I put a data table. I want this to be in its own flash page, so it ca be altered at calibration time. I have this in the .x file for the linker:

 erasabletext   (rx)   : ORIGIN = 0xc000,  LENGTH = 0x200
 text   (rx)           : ORIGIN = 0xc200,  LENGTH = 0x3fe0

In a C header file I have this:

#define __erasablemem__ __attribute__ ((section(".erasabletext")))

And then in my code I have things like:

__erasablemem__ const int a_variable;

Regards,
Steve


Frederic Beaulieu wrote:

No one has an idea about this topics?

-------------------------------

Frederic Beaulieu, M.Sc.

Research and Development

NewTrax Technologies Inc.

http://www.newtraxtech.com/

-----Original Message-----
*From:* mspgcc-users-ad...@lists.sourceforge.net [mailto:mspgcc-users-ad...@lists.sourceforge.net] *On Behalf Of *Frederic Beaulieu
*Sent:* Wednesday, May 04, 2005 11:27 AM
*To:* mspgcc-users@lists.sourceforge.net
*Subject:* RE: [Mspgcc-users] Put code and const in a same memory section

How I can specified for a memory section which type of data will be put in there?

-----Original Message-----
*From:* mspgcc-users-ad...@lists.sourceforge.net [mailto:mspgcc-users-ad...@lists.sourceforge.net] *On Behalf Of *Frederic Beaulieu
*Sent:* Wednesday, May 04, 2005 11:06 AM
*To:* MSP430 mspgcc Groups
*Subject:* [Mspgcc-users] Put code and const in a same memory section

Hi all,

I try to put a const array in a self-defined memory section (see hereafter) used originally to put code but I obtained a “section type conflict”.

I can’t understand why.

Any help will be appreciated

Fred

-----------------------------------------------------------------

Code:

*#define* __downloader_area__ __attribute__ ((section(".downloader")))

*const* Byte1_t __downloader_area__ gb1PdaMessageLength[29];

Linker:

MEMORY

{

  …

  downloader    (rx)  : ORIGIN = 0x2500,  LENGTH = 0x0b00

  …

}

SECTIONS

{

  …

  .downloader :

  {

    . = ALIGN(2);

     PROVIDE (__downloader_start = .) ;

    *(.downloader)

     PROVIDE (__downloader_end = .) ;

  } > downloader

  …

}

-----------------------------------------------------------------


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.3 - Release Date: 5/3/2005


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.3 - Release Date: 5/3/2005


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.3 - Release Date: 5/3/2005


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.3 - Release Date: 5/3/2005


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.6 - Release Date: 5/6/2005



Reply via email to