CW for S12X: Adding XGATE codes to non-XGATE project

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

CW for S12X: Adding XGATE codes to non-XGATE project

ソリューションへジャンプ
2,689件の閲覧回数
pittbull
Contributor III
Hi,
I already have a project with many source files that doesn't uses the XGATE until now...
To enable XGATE support, I copied some stuff from a template project (SetupXGATE, the .PRM, the XGATE vector table, a .cxgate file containing my new XGATE source etc.).
It compiles and links without warnings, but I can't run it.
In the linker map, there's no XGATE_CODE section. Why?
What is missing?

Thanks in advance,
-> pittbull
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
902件の閲覧回数
pittbull
Contributor III
Thank you, CompilerGuru :smileyhappy:
I have all the XGATE specific sections in my .PRM and they are also 2-byte aligned.
The hidef.h was the only missing thing...

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
902件の閲覧回数
pittbull
Contributor III
Hi again,

I just managed it. I put a
#pragma CODE_SEG __GPAGE_SEG XGATE_CODE
at the top of my .cxgate file.

It seem curious to me because CW generated .cxgate files don't need this.

Can anyone explaint that to me?

-> pittbull
0 件の賞賛
返信
902件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
The wizard generated projects do need it too, and they do have it.
But it is contained inside of hidef.h, not in the C file on its own.
Note that just the place the code especially is not enough, the XGATE also has 2 byte alignment for const and code access and for the flash only certain areas of the HCS12X are accessible.
So the delivered hidef.h contains a #pragma for all the possibly constant sections (CODE_SEG/CONST_SEG/STRING_SEG).

Daniel
0 件の賞賛
返信
903件の閲覧回数
pittbull
Contributor III
Thank you, CompilerGuru :smileyhappy:
I have all the XGATE specific sections in my .PRM and they are also 2-byte aligned.
The hidef.h was the only missing thing...
0 件の賞賛
返信