Linking CW10.5 S12 library files with CW5 S12 application projects

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

Linking CW10.5 S12 library files with CW5 S12 application projects

Jump to solution
950 Views
adeveloper
Contributor I

Hello,
we have developed a static library using the S12Z version of CW10. It works well and links with any S12Z project that we develop in CW10.
We also have S12G projects developed in CW5 and must use the same static library with those projects.

However, if we try to link an S12G project in CW5 with the .lib library file created in CW10 then we get the following link error:

"Link Error: L1400: Incompatible processor: Freescale HC12 in previous files and Freescale S12XG in current file MyLibraryFile.lib"

This is odd for 2 reasons:
1) The CW5 App project is not a 'Freescale HC12' file, but an S12 project, so it looks like CW5 is not expressing the correct architecture in it's .o object file.

2) The CW10 library is not a 'Freescale S12XG' file, but a generic S12 library, possibly of type S12Z because that's the only S12 type installed here. So it looks like CW10 is not expressing the correct architecture in it's .lib file.


Has anybody successfully linked a CW10 S12 library file with a CW5 S12 application? If so, how please?

thank you,

A Developer

Labels (1)
1 Solution
616 Views
MJW
NXP Employee
NXP Employee

Hello,

a library compiled with CW10 for S12Z cannot be linked to an S12/S12X project from CW5.1. S12Z and S12(X) are not binary compatible (S12Z cannot directly execute S12/S12X code and vice versa).

Best Regards,

MJW

View solution in original post

3 Replies
617 Views
MJW
NXP Employee
NXP Employee

Hello,

a library compiled with CW10 for S12Z cannot be linked to an S12/S12X project from CW5.1. S12Z and S12(X) are not binary compatible (S12Z cannot directly execute S12/S12X code and vice versa).

Best Regards,

MJW

616 Views
BlackNight
NXP Employee
NXP Employee

About 1): from a compiler perspective the HC12 and S12 are compatible, so the object file format uses the former HC12 notation/identifier for it.

About 2): you could decode the library/object files with the decoder.exe utility (in the prog folder). I have not tried this for a long time, but I think it shows the architectural information.

I hope this helps,

Erich

616 Views
adeveloper
Contributor I

Thank you Erich, that could be the basis of a usable workaround. I think the bigger problem (as MJW points out) is that CW10 only supports the Magnivi S12 object code set (e.g. S12Z),

whereas CW5 is only supporting the classic HC12/S12 set (e.g. S12G), so linking these is not feasible anyway until we get CW10 support for any classic HC12/S12 device.

Our library is generic C code and does not deal with the peripherals or memory map so we'd overlooked the object code differences between some S12 families.

We'll just have build our S12 Magnivi lib and Doxygen docs in CW10, then create a mirrored CW5 project for building the classic HC12/S12 lib.

It would be nice if the CW5 linker error message was improved from:

"Link Error: L1400: Incompatible processor: Freescale HC12 in previous files and Freescale S12XG in current file MyLibraryFile.lib"

to

"Link Error: L1400: Incompatible processor: Freescale HC12/S12 (classic) in previous files and Freescale S12 (Magnivi) in current file MyLibraryFile.lib"


I've put that request in a ticket.


Thanks for your help!

0 Kudos