define objects to segments in PRM file

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

define objects to segments in PRM file

2,555件の閲覧回数
mikoran
Contributor II
how can we temporarily assigned an object to segments in PRM file so that we could retrieve the starting and end addresses of a segment in PRM using __SEG_START and __SEG_END
 
tnx
ラベル(1)
0 件の賞賛
返信
3 返答(返信)

1,280件の閲覧回数
CrasyCat
Specialist III
Hello
 
It depends on the type of the object you wish to place there.
 
If it is a variable, variable definition should be done as follows:
#pragma DATA_SEG MyDataSegment
int myVar;
#pragma DATA:smileyfrustrated:EG DEFAULT.
You can then retrieve the segment start & end address using __SEG_START_MyDataSegment and __SEG_END_MyDataSegment .
 
If it is a constant, constant definition should be done as follows:
#pragma CONST_SEG MyConstSegment
conts int myVar= 10;
#pragma CONST_SEG DEFAULT.
You can then retrieve the segment start & end address using __SEG_START_MyConstSegment and __SEG_END_MyConstSegment.
 
If it is a function, function implementation should be done as follows:
#pragma CODE_SEG MyCodeSegment
void foo(void) {
}
#pragma CODE_SEG DEFAULT.
You can then retrieve the segment start & end address using __SEG_START_MyCodeSegment and __SEG_END_MyCodeSegment.
 .
 
CrasyCat
0 件の賞賛
返信

1,280件の閲覧回数
mikoran
Contributor II
I tried it but it doesnt work. Still I got zero as the value for start and end address..
0 件の賞賛
返信

1,280件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
What's the difference in this issue compared to
http://forums.freescale.com/freescale/board/message?board.id=16BITCOMM&message.id=6209
?

In that issue you did not actually place anything in those sections, and therefore the linker did not allocate it and therefore you got 0. Did you now allocate something?

Anyway, please provide much more details, otherwise I don't think it is possible to help much, we just would guess what your problem is, and we probably guess incorrectly.

Also have a look at the startup code, there the end address of the stack is taken with this method, there it does work. So you can check what you do differently.

Daniel
0 件の賞賛
返信