Locating data in a specific ROM section
Hi ST world,
I’d like to create some specific section in flash.
Can I find a reference  documentation about the linker behavior somewhere ?
If not, here is what I did in my linker script:
Create a second const memory
/* Memories definition */
MEMORY
{
  ROM_Code 	(rx)		: ORIGIN = 0x8000000, 	LENGTH = 448K
  ROM_Data	(r)			: ORIGIN = 0x8060000, 	LENGTH = 128K
  RAM 		(xrw)		: ORIGIN = 0x20000000, 	LENGTH = 128K
}
/* Sections */
SECTIONS
{
..... AUTOMATICALLY SET SECTIONS
/* Specific const section*/
  ._const_data :
  {
    . = ALIGN(4);
    *(._const_data) 		/* .text sections (code) */
    *(._const_data*)		/* .text* sections (code) */
    . = ALIGN(4);
    _e_cdata = .;        /* define a global symbols at end of data */
  } >ROM_Data
}
Is it the correct way to do this ?
My program links ok with this modified linker script, nevertheless, how can I explicitely set a variable to be in “_const_data” section from a C file? Should I use some pragmas ?
Thanks for your help,
Regards,
Sylvain


