__SP_INIT and the library FP_fixedI_Thumb_LE_v7M.a (CW10.2 SE)

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

__SP_INIT and the library FP_fixedI_Thumb_LE_v7M.a (CW10.2 SE)

Jump to solution
1,682 Views
mjbcswitzerland
Specialist V

Hi All

 

Can anyone explain the following (Kinetis)?

 

- CW10.2 SE is used on two PCs (not at the same location and, although both CW10.2, presumably not identical builds)

- A particular project builds correctly on one but fails with a missing symbol when linking on the other.

- The missing symbol is __SP_INIT and it looks as though this is being used by the library FP_fixedI_Thumb_LE_v7M.a

 

When __SP_INIT is added to the linker script (given any value) the linker works.

 

What can the library be doing with this and are the versions of the library changed between (intermediate) version for CW10.2?

 

Regards

 

Mark

Labels (1)
0 Kudos
1 Solution
774 Views
BlackNight
NXP Employee
NXP Employee

Hi Mark,

indeed, this one is different (but the same thing). I checked again, and indeed the linker always needs that symbol internally. Well, it asks for it, even if obviously not used. Not logical, and I think this will be fixed. For now: add that symbol for the linker.

 

BK

View solution in original post

0 Kudos
6 Replies
774 Views
BlackNight
NXP Employee
NXP Employee

Hi Mark,

that's a problem introduced with the Kinetis Linker which comes with the MCU10.2 1.0.0. patch (MCU 10.2 Update 1.0.0 on http://www.freescale.com/webapp/sps/site/overview.jsp?code=CW_UPDATES_MCU_10_2).

That new linker expects a symbol __SP_INIT in the linker file. If you are using your own startup code (not using __SP_INIT), then everything is fine. But if you are using the new library startup code, then this symbol is required (used).

So if you are using a 10.1 linker file not having that symbol defined and with the new linker/library, you will see an error from the linker asking for that symbol.

 

That's why I have added __SP_INIT even to my 10.2 projects I'm using without the udpated version.

 

Hope this helps,

BK

0 Kudos
774 Views
mjbcswitzerland
Specialist V

Hi BK

 

Thanks. I have added a symbol __SP_INIT to the linker script so that the build is successful but am wondering whether its value is of importance?

The start-up code from the library isn't being used but maybe it is getting linked in somehow nevertheless(?)

 

Regards

 

Mark

 

0 Kudos
774 Views
BlackNight
NXP Employee
NXP Employee

Hi Mark,

Have a look at the actual linker error message. For me it gives:

 

>Undefined : "__SP_INIT"
C:/Freescale/CW MCU v10.2/MCU/ARM_Tools/Command_Line_Tools/mwldarm|Linker|Error
(D:\workspace\ARM_CORTEXM\ARM_CortexM_Component\ewl\EWL_Runtime\Runtime_ARM\Source\startup.c|189|0|0|0|0)
=Referenced from "__thumb_startup" in librt_Thumb_LE_v7M.a

 

At least in my case it references that symbol from the __thumb_startup.

 

Hope this helps,

BK

0 Kudos
774 Views
mjbcswitzerland
Specialist V

BK

 

It looks to be a different case since there is no indication as to what is using the symbol (just the indication that it may have something to do with the library but I think that this was in fact a red-herring and it is the linker itself that wants to find it somewhere). This is the complete error report:

 

'Invoking: ARM Linker'
"C:/Freescale/CW_MCU_v10.2/MCU/ARM_Tools/Command_Line_Tools/mwldarm" @@"uTaskerBoot.args" -o "uTaskerBoot.afx"   -l"C:/Freescale/CW_MCU_v10.2/MCU/ARM_EABI_Support/ewl/EWL_Runtime/Runtime_ARM/Mathlib/lib/FP_fixedI_Thumb_LE_v7M.a"
C:/Freescale/CW_MCU_v10.2/MCU/ARM_Tools/Command_Line_Tools/mwldarm|Linker|Error
>Internal-Symbol not found:
>__SP_INIT
C:/Freescale/CW_MCU_v10.2/MCU/ARM_Tools/Command_Line_Tools/mwldarm|Linker|Error
>Internal-Symbol not found:
>__SP_INIT
C:/Freescale/CW_MCU_v10.2/MCU/ARM_Tools/Command_Line_Tools/mwldarm|Linker|Error
>Link failed.

Errors caused tool to abort.
mingw32-make: *** [uTaskerBoot.afx] Error 1

 

Regards

 

Mark

 

 

0 Kudos
775 Views
BlackNight
NXP Employee
NXP Employee

Hi Mark,

indeed, this one is different (but the same thing). I checked again, and indeed the linker always needs that symbol internally. Well, it asks for it, even if obviously not used. Not logical, and I think this will be fixed. For now: add that symbol for the linker.

 

BK

0 Kudos
774 Views
mjbcswitzerland
Specialist V

Hi Eric

I have used FP for some time on K61s and K70s but for a project with K60 - without the FPU - we have been failing. The problem being with the FPU library files needed - the thread is here but hasn't generated any answers so I am hopeing that kicking this old (related) one may get it noticed instead: Re: How to use simple floating point (Kinetis)?

For the moment we gave up after spending a long time trying to solve it and moved to GCC for standard development where the libraries (maybe not as well optimised to the task) are all there by default. However the product that it is for allows users to add their own code for special control applications (as well as using standard inbuilt code with its own interpreter language) - packages are being prepared so that the users can chose their own environment (IAR, Rowley Crossworks, Keil, Atollic, GCC standalone) and Codewarrior really should be there too; if we could work out how to solve its library issue...

Probably you have experience to answer in a few seconds (?)

Regards

Mark

0 Kudos