Linker Message - missing symbol on S12X port

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

Linker Message - missing symbol on S12X port

Jump to solution
1,920 Views
Ironhorse
Contributor I

I am trying to port a little bit of CAN code from S08DZ to S12XD using CodeWarrior for HCS12 V4.7.  (attached)

 

I have cleared up many things but the following is confusing me.

 

I am getting message Link Error : L1822 saying symbols _LSHRU, _BSHL, and _LSHL are undefined.  I do not recognize these symbols.  I cannot find any of them in my S08DZ or S12XD code.  I suppose they are specific to one or the other target.

 

I had a similar message regarding symbol _Startup, which I fix by getting the start12 files in the same place.  There was no message that I was missing those files.  Am I missing some S12XD file that has these symbols? Some memory map?

 

These symbols are said to be missing from a file that was originally a CAN.c file generated by PE for the S08DZ.  I do not intend to continue to use the PE generated code for CAN so I wish to learn what is going on here.

 

Thanks.

Labels (1)
0 Kudos
1 Solution
994 Views
kef
Specialist I

_BSHL is byte shift left routine, _LSHRU - long shift right unsigned, _LSHL - long shift left

 

I guess you removed or forgot to add required library file.

View solution in original post

0 Kudos
11 Replies
995 Views
kef
Specialist I

_BSHL is byte shift left routine, _LSHRU - long shift right unsigned, _LSHL - long shift left

 

I guess you removed or forgot to add required library file.

0 Kudos
994 Views
Ironhorse
Contributor I

kef- "I guess you removed or forgot to add required library file."

 

I'm thinking that, too, but I haven't figured which one yet,

Thought for a moment it might be the mc9s12xdp512.h/.inc files?

0 Kudos
994 Views
Ironhorse
Contributor I

OK, I think these may be S12X symbols, specifically associated with XGATE shared memory.

 

SHL = Shared Region Lower?

 

http://notes-application.abcelectronique.com/314/314-68219.pdf

 

Let me note at this point, that I intend to start out with XGATE turned off and employ it later where it can do the most good.

0 Kudos
994 Views
Ironhorse
Contributor I

But the question remains, what and where are these symbols?

0 Kudos
994 Views
CompilerGuru
NXP Employee
NXP Employee

Those are part of the compilers runtime support.

So either link against the proper ansi library (see lib/hc12c/readme.txt) or include the lib/hc12c/src/rtshc12.c in your build.

 

In general it might be easier to start with a wizard generated project than from scratch to have such things taken care of properly.

Daniel

0 Kudos
994 Views
Ironhorse
Contributor I

Daniel - "In general it might be easier to start with a wizard generated project than from scratch to have such things taken care of properly."

 

Sure.  But, I was curious to see how PE would work if I could change processors just by deselecting the S08DZ and selecting the S12XD.

 

I will look at the libraries you suggested.  And also try  making a new empty project and import my existing code into that.

 

 

0 Kudos
994 Views
Ironhorse
Contributor I

"_BSHL is byte shift left routine"

 

Some ancient memory was actually trying to tell me that, feebly - thanks.

0 Kudos
994 Views
Ironhorse
Contributor I

“(see lib/hc12c/readme.txt)”

 

Ah, one of the PE beans was giving me a message like “use the compile command ‘-CpuHCS12X’” can’t find that message at the moment though.  Am still working on it.

 

 

0 Kudos
994 Views
Ironhorse
Contributor I

OK, copied in ansibi.lib (no float, banked memory)

Was able to then get it to all compile on my reused S08DZ code.

I was getting close the other way, but it was quicker to start with a new project.

 

I'll set up the clock settings tomorow and see how the software runs tomorrow.

 

Thank you,

 

0 Kudos
994 Views
Ironhorse
Contributor I

BTW, adding the ansi##.lib worked,

 

Thank you.

0 Kudos
994 Views
Ironhorse
Contributor I

I've also just changed the compiler instruction " -CpuHCS12" to " -CpuHCS12X"

0 Kudos