CW6.3 MCF5307 - error declaring sections in source code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

CW6.3 MCF5307 - error declaring sections in source code

2,259 次查看
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

标签 (1)
标记 (1)
0 项奖励
回复
2 回复数

844 次查看
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 项奖励
回复

844 次查看
Veter
Contributor I
This is great!
Thank you so much!
0 项奖励
回复