KDS v3.0.0: Floatting point  library

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

KDS v3.0.0: Floatting point  library

1,747 Views
arnogir
Senior Contributor II

Hello

 

I try to use the new KDS v3.0.0.

 

Before, in KDS v2.0.0, for my project, I configured Hardware floating point.

Then, to linked, I added in Project Properties / Settings/ Cross ARM C++ Linker / Miscellaneous, the following library link:

 

${eclipse_home}/../toolchain/lib/gcc/arm-none-eabi/4.8.0/m4/fp/v4-sp-d16/libgcc.a

${eclipse_home}/../toolchain/arm-none-eabi/lib/m4/fp/v4-sp-d16/libc.a

${eclipse_home}/../toolchain/arm-none-eabi/lib/m4/fp/v4-sp-d16/libsupc++.a

${eclipse_home}/../toolchain/arm-none-eabi/lib/m4/fp/v4-sp-d16/libm.a

 

which correspond to this absolute path:

 

C:\Freescale\KDS_2.0.0\toolchain\lib\gcc\arm-none-eabi\4.8.0\m4\fp\v4-sp-d16\libgcc.a

 

C:\Freescale\KDS_2.0.0\toolchain\arm-none-eabi\lib\m4\fp\v4-sp-d16\libc.a

 

C:\Freescale\KDS_2.0.0\toolchain\arm-none-eabi\lib\m4\fp\v4-sp-d16\libsupc++.a

 

C:\Freescale\KDS_2.0.0\toolchain\arm-none-eabi\lib\m4\fp\v4-sp-d16\libm.a

 

I'm using a K60 (cortex m4)

 

But now, in the KDS 3.0.0 install repositories these repositories does not exist.

Where can I find the good library to work on Hw Floating point (with FPU) ?

 

I see for armv6-m, v7-m, and in a root, but how choose one?

 

Labels (1)
0 Kudos
6 Replies

712 Views
BlackNight
NXP Employee
NXP Employee

Hi Arnaud,

is there a special reason why you specify the libraries 'by hand'?

Because if you use the right family with Float support, it will link the correct libraries:

pastedImage_1.png

pastedImage_2.png

Additionally, have a look at this document: Kinetis Design Studio: Migrating KDS V2.0.0 Projects to GNU Tools for ARM Embedded (Launchpad, KDS V...

Erich

0 Kudos

712 Views
arnogir
Senior Contributor II

Hello

I have exactly the same configuration than your screenshot.

But if I don't add these link, I have many error on link time.

I don't Remember where I found the way to add these library in configuration, but with this, project Link correctly.

:smileyconfused:

Sources\DV_Stepper\DV_Stepper.o: In function `DV_Stepper_AddPulse':

C:\Projet\Croma\C8Axes\trunk\C8Axes\Kds_Project\Debug/..\..\Sources\DV_Stepper/DV_Stepper.c:255: undefined reference to `__aeabi_uldivmod'

Sources\AP_Position\AP_Position.o: In function `AP_Position_iCalculStepperPulse':

C:\Projet\Croma\C8Axes\trunk\C8Axes\Kds_Project\Debug/..\..\Sources\AP_Position/AP_Position.c:325: undefined reference to `__aeabi_uldivmod'

C:\Projet\Croma\C8Axes\trunk\C8Axes\Kds_Project\Debug/..\..\Sources\AP_Position/AP_Position.c:332: undefined reference to `__aeabi_uldivmod'

C:\Freescale\Freescale_MQX_4_1\lib\twrk60n512.kds\debug\bsp\bsp.a(macnet_send.o): In function `MACNET_send':

C:\Freescale\Freescale_MQX_4_1\mqx\build\kds\bsp_twrk60n512\Debug/..\..\..\..\source\io\enet\macnet/macnet_send.c:152: undefined reference to `memcpy'

C:\Freescale\Freescale_MQX_4_1\lib\twrk60n512.kds\debug\bsp\bsp.a(macnet_receive.o): In function `MACNET_process_rx_bds':

C:\Freescale\Freescale_MQX_4_1\mqx\build\kds\bsp_twrk60n512\Debug/..\..\..\..\source\io\enet\macnet/macnet_receive.c:448: undefined reference to `memcpy'

C:\Freescale\Freescale_MQX_4_1\mqx\build\kds\bsp_twrk60n512\Debug/..\..\..\..\source\io\enet\macnet/macnet_receive.c:474: undefined reference to `memcpy'

C:\Freescale\Freescale_MQX_4_1\lib\twrk60n512.kds\debug\psp\psp.a(task.o): In function `_task_alloc_td_internal':

C:\Freescale\Freescale_MQX_4_1\mqx\build\kds\psp_twrk60n512\Debug/..\..\..\..\source\kernel/task.c:3533: undefined reference to `memset'

C:\Freescale\Freescale_MQX_4_1\lib\twrk60n512.kds\debug\psp\psp.a(mqx.o): In function `_mqx':

C:\Freescale\Freescale_MQX_4_1\mqx\build\kds\psp_twrk60n512\Debug/..\..\..\..\source\kernel/mqx.c:178: undefined reference to `memset'

C:\Freescale\Freescale_MQX_4_1\lib\twrk60n512.kds\debug\psp\psp.a(lwmem.o): In function `_lwmem_alloc_internal':

C:\Freescale\Freescale_MQX_4_1\mqx\build\kds\psp_twrk60n512\Debug/..\..\..\..\source\kernel/lwmem.c:175: undefined reference to `memset

0 Kudos

712 Views
BlackNight
NXP Employee
NXP Employee

I believe there must be something really wrong with your settings, because the linker shall be able to find the libraries automatically with the correct settings. Can you compare your compiler/linker settings?

I have this (as reference example):

'Invoking: Cross ARM C Compiler'

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -D"CPU_MK64FN1M0VMD12" -DFSL_RTOS_FREE_RTOS -I"../Sources" -I"../Project_Settings/Startup_Code" -I"../SDK/platform/CMSIS/Include" -I"../SDK/platform/devices" -I"../SDK/platform/devices/MK64F12/include" -I"../Percepio" -I"../SDK/rtos/FreeRTOS/src" -I"../SDK/rtos/FreeRTOS/include" -I"../SDK/rtos/FreeRTOS/port/gcc" -I"../SDK/platform/drivers/src/uart" -I"../SDK/platform/drivers/src/rtc" -I"../SDK/platform/drivers/inc" -I"../SDK/platform/drivers/src/gpio" -I"../SDK/platform/osa/src" -I"../SDK/platform/osa/inc" -I"../SDK/platform/hal/src/mcg" -I"../SDK/platform/hal/src/rtc" -I"../SDK/platform/hal/src/uart" -I"../SDK/platform/hal/src/gpio" -I"../SDK/platform/hal/src/osc" -I"../SDK/platform/hal/src/sim/MK64F12" -I"../SDK/platform/hal/inc" -I"../SDK/platform/hal/src/port" -I"../SDK/platform/system/inc" -I"../SDK/platform/system/src/interrupt" -I"../SDK/platform/system/src/clock" -I"../SDK/platform/system/src/clock/MK64F12" -I"../SDK/platform/utilities/inc" -I"../SDK/platform/utilities/src" -std=c99 -MMD -MP -MF"Sources/main.d" -MT"Sources/main.o" -c -o "Sources/main.o" "../Sources/main.c"

'Finished building: ../Sources/main.c'

' '

'Building target: Lab_KSDK_FreeRTOS.elf'

'Invoking: Cross ARM C++ Linker'

arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -T "MK64FN1M0xxx12_flash.ld" -Xlinker --gc-sections -L"P:/KDS/FRDM-K64F120M/Lab_KSDK_FreeRTOS/Project_Settings/Linker_Files" -Wl,-Map,"Lab_KSDK_FreeRTOS.map" -specs=nosys.specs -specs=nano.specs -o "Lab_KSDK_FreeRTOS.elf"  ./Sources/FreeRTOS_Trace.o ./Sources/ShellQueue.o ./Sources/Utility.o ./Sources/board.o ./Sources/gpio_pins.o ./Sources/hardware_init.o ./Sources/main.o ./Sources/pin_mux.o  ./SDK/rtos/FreeRTOS/src/croutine.o ./SDK/rtos/FreeRTOS/src/event_groups.o ./SDK/rtos/FreeRTOS/src/heap_1.o ./SDK/rtos/FreeRTOS/src/heap_2.o ./SDK/rtos/FreeRTOS/src/heap_3.o ./SDK/rtos/FreeRTOS/src/heap_4.o ./SDK/rtos/FreeRTOS/src/heap_5.o ./SDK/rtos/FreeRTOS/src/list.o ./SDK/rtos/FreeRTOS/src/queue.o ./SDK/rtos/FreeRTOS/src/tasks.o ./SDK/rtos/FreeRTOS/src/timers.o  ./SDK/rtos/FreeRTOS/port/gcc/port.o ./SDK/rtos/FreeRTOS/port/gcc/portasm.o  ./SDK/platform/utilities/src/fsl_debug_console.o ./SDK/platform/utilities/src/print_scan.o  ./SDK/platform/system/src/interrupt/fsl_interrupt_manager.o  ./SDK/platform/system/src/clock/MK64F12/fsl_clock_MK64F12.o  ./SDK/platform/system/src/clock/fsl_clock_manager.o ./SDK/platform/system/src/clock/fsl_clock_manager_common.o  ./SDK/platform/osa/src/fsl_os_abstraction_free_rtos.o  ./SDK/platform/hal/src/uart/fsl_uart_hal.o  ./SDK/platform/hal/src/smc/fsl_smc_hal.o  ./SDK/platform/hal/src/sim/MK64F12/fsl_sim_hal_MK64F12.o  ./SDK/platform/hal/src/rtc/fsl_rtc_hal.o  ./SDK/platform/hal/src/port/fsl_port_hal.o  ./SDK/platform/hal/src/osc/fsl_osc_hal.o  ./SDK/platform/hal/src/mcg/fsl_mcg_hal.o ./SDK/platform/hal/src/mcg/fsl_mcg_hal_modes.o  ./SDK/platform/hal/src/gpio/fsl_gpio_hal.o  ./SDK/platform/drivers/src/uart/fsl_uart_common.o ./SDK/platform/drivers/src/uart/fsl_uart_driver.o  ./SDK/platform/drivers/src/rtc/fsl_rtc_common.o  ./SDK/platform/drivers/src/gpio/fsl_gpio_common.o ./SDK/platform/drivers/src/gpio/fsl_gpio_driver.o  ./Project_Settings/Startup_Code/startup.o ./Project_Settings/Startup_Code/startup_MK64F12.o ./Project_Settings/Startup_Code/system_MK64F12.o  ./Percepio/trcBase.o ./Percepio/trcHardwarePort.o ./Percepio/trcKernel.o ./Percepio/trcKernelPort.o ./Percepio/trcUser.o  

'Finished building target: Lab_KSDK_FreeRTOS.elf'

Erich

0 Kudos

712 Views
arnogir
Senior Contributor II

Hi,

I tested to open MQX 4.2  example (hello2) with KDS 3.0.0.

The linker configuration has following Miscellaneous object:

${eclipse_home}../toolchain/lib/gcc/arm-none-eabi/4.8.4/armv7e-m/libgcc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/libc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/libsupc++.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/libm.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/libnosys.a

With this, project option is on Float ABI : Library(Soft)

By changing this option to FP Hard,code not link.

I changed linked library by following (taken in hazardous way!):

${eclipse_home}../toolchain/lib/gcc/arm-none-eabi/4.8.4/fpu/libgcc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/fpu/libc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/fpu/libsupc++.a

${eclipse_home}../toolchain/arm-none-eabi/lib/fpu/libm.a

${eclipse_home}../toolchain/arm-none-eabi/lib/fpu/libnosys.a

Other path work also:

${eclipse_home}../toolchain/lib/gcc/arm-none-eabi/4.8.4/armv7e-m/fpu/libgcc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libsupc++.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libm.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libnosys.a

With this, code compile and link with Fpu Hard option. But I don't know if this is the optimal library for my processor? I don't know the possible bad effect if I don't choose the good library???

Note: I'm using currently the K60DN512 (No FPU) But I will  changed to a K60FX1M0 (With FPU)

0 Kudos

712 Views
arnogir
Senior Contributor II

Hello

I seen a thing in your line because you use SDK:

-L"P:/KDS/FRDM-K64F120M/Lab_KSDK_FreeRTOS/Project_Settings/Linker_Files"

What is these files? Maybe in these file, path is given? So this is why you does not need to add it manually like me in Miscellaneous Linker option??

0 Kudos

712 Views
BlackNight
NXP Employee
NXP Employee

The -L option tells the linker where to search for the linker file(s). That's usually a better way than to specify the path together with the linker file name.

0 Kudos