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

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

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

跳至解决方案
2,465 次查看
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 解答
678 次查看
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 回复数
678 次查看
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 项奖励
678 次查看
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 项奖励
679 次查看
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 项奖励