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

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

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

Jump to solution
2,427 Views
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
Labels (1)
Tags (1)
0 Kudos
1 Solution
640 Views
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...

View solution in original post

0 Kudos
3 Replies
640 Views
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 Kudos
640 Views
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 Kudos
641 Views
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 Kudos