Which library is required for using KL devices?

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

Which library is required for using KL devices?

Jump to solution
3,314 Views
mjbcswitzerland
Specialist V

Hi

 

I notice that K devices build without there being any libraries specified but KL devices doen't - there are missing low-level calls required by the compiler.

 

When using CW10.5 I found that KL devices needed the library "${MCUToolsBaseDir}/ARM_GCC_Support/ewl/lib/armv6-m"

 

What is suitable in the KDS environment?

 

Regards

 

Mark

Labels (1)
0 Kudos
Reply
1 Solution
2,785 Views
mjbcswitzerland
Specialist V

Erich

Thanks.

I found that I can built for the Cortex M4 without using default libraries (-nostdlib) but I need to enable default libraries for the Cortex M0plus (just use -nostartfiles).

Therefore when I use this setting it then works form both core types and there doesn't look to be any side-effects for the Cortex-4 sinc ethe generated coded is the same.

Regards

Mark

View solution in original post

0 Kudos
Reply
4 Replies
2,785 Views
BlackNight
NXP Employee
NXP Employee

Hi Marc,

The GNU ARM Embedded toolchain in CodeWarrior is different from the one used in KDS.

The CodeWarrior 'ewl' library is a CodeWarrior (Embedded Warrior Library) specific one. KDS is using open source libraries instead.

Which low level calls are you missing? The GNU toolchain in KDS automatically links with the newlib. You can change this to the newlib-nano with using the -nanolibc linker option.

Regards,

Erich

0 Kudos
Reply
2,785 Views
mjbcswitzerland
Specialist V

Erich

When I select Cortex-m0plus (rather than Cortex-m4) the following functions are missing at the moment:

__aeabi_uidiv

__aeabi_idiv
__gnu_thumb1_case_uqi

__gnu_thumb1_case_uhi

I don't yet see where libraries are being linked and also I haven't been able to locate the libary files themselves in the package.

Regards

Mark

0 Kudos
Reply
2,785 Views
BlackNight
NXP Employee
NXP Employee

Mark,

I'm using cortex-m0plus too, and do not see any missing functions:

make all

'Building target: FRDM-KL25Z_bare.elf'

'Invoking: Cross ARM C++ Linker'

arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -T "LinkerFile.ld" -Xlinker --gc-sections -L"C:/tmp/wsp_KDS_v1.0.1/FRDM-KL25Z_bare/Project_Settings/Linker_Files" -Wl,-Map,"FRDM-KL25Z_bare.map" -nanolibc -o "FRDM-KL25Z_bare.elf"  ./Sources/cfmconfig.o ./Sources/main.o  ./Project_Settings/Startup_Code/Vectors.o ./Project_Settings/Startup_Code/startup.o

'Finished building target: FRDM-KL25Z_bare.elf'

' '

'Invoking: Cross ARM GNU Print Size'

arm-none-eabi-size --format=berkeley "FRDM-KL25Z_bare.elf"

  text      data        bss        dec        hex    filename

  1400        32      1136      2568        a08    FRDM-KL25Z_bare.elf

'Finished building: FRDM-KL25Z_bare.siz'

But my program is using __udivsi3 and __divsi3.

So it looks to me that you are linking with libraries which have been built with differernt settings or with a different compiler?

The thing is that KDS is *not* using the launchpad GNU ARM gcc, but a GNU ARM gcc.

It looks like you need a launpad GNU ARM toolchain?

I have my project attached as a reference.

Erich

2,786 Views
mjbcswitzerland
Specialist V

Erich

Thanks.

I found that I can built for the Cortex M4 without using default libraries (-nostdlib) but I need to enable default libraries for the Cortex M0plus (just use -nostartfiles).

Therefore when I use this setting it then works form both core types and there doesn't look to be any side-effects for the Cortex-4 sinc ethe generated coded is the same.

Regards

Mark

0 Kudos
Reply