Migration from KDS2 to KDS3, link problem

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

Migration from KDS2 to KDS3, link problem

Jump to solution
1,976 Views
dafodil
Contributor III

Hi,

 

I try to compile a KDS2 project with KDS3. The project is with K64F, KDSK110, Processeur Expert and MQX RTCS, under Windows7, I followed this post Kinetis Design Studio: Migrating KDS V2.0.0 Projects to GNU Tools for ARM Embedded (Launchpad, KDS V... very usefull.

 

but I got some problem to solve the error below, it seems to be a problem with Semihosting, not sure,

 

make -j4 all

Building target: project_maf.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 "L:/KDS3.0.0/ws_IDD4CLETHBt/project_maf/Project_Settings/Linker_Files/ProcessorExpert.ld" -Xlinker --gc-sections -L"L:/KDS3.0.0/ws_IDD4CLETHBt/project_maf/Project_Settings/Linker_Files" -Wl,-Map,"project_maf.map" -nostartfiles -nodefaultlibs -nostdlib -Xlinker -z -Xlinker muldefs -Xlinker -static  -specs=rdimon.specs -o "project_maf.elf"  ./flash/CopyToRam.o ./flash/DEFlashPartition.o [...]

C:/Freescale/KDS_3.0.0/eclipse//../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-signalr.o): In function `_kill_r':

signalr.c:(.text._kill_r+0xe): undefined reference to `_kill'

C:/Freescale/KDS_3.0.0/eclipse//../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-signalr.o): In function `_getpid_r':

signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid'

C:/Freescale/KDS_3.0.0/eclipse//../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-writer.o): In function `_write_r':

writer.c:(.text._write_r+0x10): undefined reference to `_write'

C:/Freescale/KDS_3.0.0/eclipse//../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-closer.o): In function `_close_r':

closer.c:(.text._close_r+0xc): undefined reference to `_close'

C:/Freescale/KDS_3.0.0/eclipse//../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-fstatr.o): In function `_fstat_r':

fstatr.c:(.text._fstat_r+0xe): undefined reference to `_fstat'

C:/Freescale/KDS_3.0.0/eclipse//../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-isattyr.o): In function `_isatty_r':

isattyr.c:(.text._isatty_r+0xc): undefined reference to `_isatty'

C:/Freescale/KDS_3.0.0/eclipse//../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-lseekr.o): In function `_lseek_r':

lseekr.c:(.text._lseek_r+0x10): undefined reference to `_lseek'

C:/Freescale/KDS_3.0.0/eclipse//../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libc.a(lib_a-readr.o): In function `_read_r':

readr.c:(.text._read_r+0x10): undefined reference to `_read'

collect2.exe: error: ld returned 1 exit status

makefile:98: recipe for target 'project_maf.elf' failed

make: *** [project_maf.elf] Error 1

 

I tried to add -specs=rdimon.specs and -specs=nosys.specs, I got same error messages.

 

Do you have any idea?

 

Regards

Labels (1)
Tags (1)
1 Solution
995 Views
BlackNight
NXP Employee
NXP Employee

Hi Bernard,

I think this in the linker options is your problem:

-nostartfiles -nodefaultlibs -nostdlib -Xlinker -z -Xlinker muldefs -Xlinker -static

With this, you say that the linker should not use the default libraries and standard libraries: I suggest you try this:

pastedImage_0.png

Not sure why you have the additional -Xinker options, are they needed by MQX?

Erich

View solution in original post

0 Kudos
Reply
4 Replies
996 Views
BlackNight
NXP Employee
NXP Employee

Hi Bernard,

I think this in the linker options is your problem:

-nostartfiles -nodefaultlibs -nostdlib -Xlinker -z -Xlinker muldefs -Xlinker -static

With this, you say that the linker should not use the default libraries and standard libraries: I suggest you try this:

pastedImage_0.png

Not sure why you have the additional -Xinker options, are they needed by MQX?

Erich

0 Kudos
Reply
995 Views
wyflsxy
Contributor II

hello,I have the same question,

but when I removed -nostartfiles -nodefaultlibs -nostdlib follow you

it don't outout the *.elf file only an a.out

and I can't download it to my board

could you help me??

'Building target: mytask_k64.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 E:\Freescale\KSDK_1.2.0\platform\devices\MK64F12\linker\gcc\MK64FN1M0xxx12_flash.ld -Xlinker --gc-sections -L"E:\Freescale\KSDK_1.2.0\lib\ksdk_mqx_lib\kds\K64F12\debug" -L"E:\Freescale\KSDK_1.2.0\lib\ksdk_platform_lib\kds\K64F12\debug -L"E:\Freescale\KSDK_1.2.0\rtos\mqx\lib\frdmk64f.kds\debug\nshell" -L"E:\Freescale\KSDK_1.2.0\middleware\filesystem\mfs\lib\frdmk64f.kds\debug\mfs" -L"E:\Freescale\KSDK_1.2.0\middleware\tcpip\rtcs\lib\frdmk64f.kds\debug\rtcs" -L"E:\Freescale\KSDK_1.2.0\rtos\mqx\lib\frdmk64f.kds\debug\mqx_stdlib" -L"E:\Freescale\KSDK_1.2.0\rtos\mqx\lib\frdmk64f.kds\debug\mqx" -Wl,-Map,"mytask_k64.map" -Xlinker --cref --specs=nano.specs -Xlinker -static -Xlinker -z -Xlinker muldefs -Xlinker --undefined=__isr_vector -Xlinker --defsym=__stack_size__=0x400 -Xlinker --defsym=__heap_size__=0x200 -o "mytask_k64.elf"  ./Sources/main.o  ./KSDK_Files/board.o ./KSDK_Files/gpio_pins.o ./KSDK_Files/pin_mux.o  ./Debug_Console/fsl_debug_console.o ./Debug_Console/fsl_misc_utilities.o ./Debug_Console/print_scan.o  ./BSP_Files/init_bsp.o ./BSP_Files/mqx_main.o  ./main.o  E:/Freescale/KSDK_1.2.0/lib/ksdk_mqx_lib/kds/K64F12/debug/libksdk_platform_mqx.a E:/Freescale/KSDK_1.2.0/middleware/tcpip/rtcs/lib/frdmk64f.kds/debug/rtcs/lib_rtcs.a E:/Freescale/KSDK_1.2.0/lib/ksdk_platform_lib/kds/K64F12/debug/libksdk_platform.a E:/Freescale/KSDK_1.2.0/middleware/filesystem/mfs/lib/frdmk64f.kds/debug/mfs/lib_mfs.a E:/Freescale/KSDK_1.2.0/rtos/mqx/lib/frdmk64f.kds/debug/nshell/lib_nshell.a E:/Freescale/KSDK_1.2.0/rtos/mqx/lib/frdmk64f.kds/debug/mqx_stdlib/lib_mqx_stdlib.a E:/Freescale/KSDK_1.2.0/rtos/mqx/lib/frdmk64f.kds/debug/mqx/lib_mqx.a -lksdk_platform_mqx -l_mqx_stdlib -l_mqx -lgcc -lc -lsupc++ -lm -lnosys

e:/freescale/kds_3.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol Reset_Handler; defaulting to 00000410

'Finished building target: mytask_k64.elf'

0 Kudos
Reply
995 Views
markkurönö
Contributor I

Erich Styger kirjoitti:

I think this in the linker options is your problem:

-nostartfiles -nodefaultlibs -nostdlib -Xlinker -z -Xlinker muldefs -Xlinker -static

Not sure why you have the additional -Xinker options, are they needed by MQX?

I also experienced this after installing KDS3.0 alongside KDS2.0

After trying KDS3.0, all my projects in KDS2.0 workspace got those odd options, and failed to compile.

Also, the checkboxes you highlighted were not checked, but the -nostartfiles etc options were added directly to the text field on the Miscellaneous tab.

0 Kudos
Reply
995 Views
dafodil
Contributor III

Hi Erich,

Yes, you are good.

I removed -nostartfiles -nodefaultlibs -nostdlib

and add -specs=rdimon.specs

I got no errors, cool.

Bernard

0 Kudos
Reply