CW6.3 MCF5307 - error declaring sections in source code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CW6.3 MCF5307 - error declaring sections in source code

1,748 Views
Veter
Contributor I

I have following section declaration in my *.c file: #pragma section CONST ".constdata"

I also have this statement in my *.lcf file:

.flashdata : AT( ADDR(.flashcode) + SIZEOF(.flashcode) )  {... *(.constdata) ...} > sdram

I would expect to see something like this in my *.xMAP file: .constdata      <address> <size> <source>.o

Does any one knows how to declare sections in source code?

I am using CodeWarrior Develoment Studio for ColdFire Version 6.3, Build 14.

My target is MCF5307.

Message Edited by Veter on 2007-03-2704:13 PM

--
Alban added CW version + core in subject line

Message Edited by Alban on 2007-03-27 11:38 PM

Labels (1)
0 Kudos
2 Replies

333 Views
CrasyCat
Specialist III
Hello
 
You have to use the pragma define_section and the modifier declspec.
 
Example:
#pragma define_section myConst ".myConst" far_absolute R
__declspec(myConst) int cst = 0x45;
 
Then refer to section .const in the section part of the lcf file.
CrasyCat
0 Kudos

333 Views
Veter
Contributor I
This is great!
Thank you so much!
0 Kudos