FRDM-K64F Hello World Demo Undefined Reference

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

FRDM-K64F Hello World Demo Undefined Reference

Jump to solution
1,672 Views
stephenspears
Contributor II

I have read the Getting Started with Kinetis SDK tutorial as well as the updated Hello World with GPIO interrupt.  I can't get rid of these errors:

 

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/Utilities/fsl_debug_console.c:154: undefined reference to `CLOCK_SYS_EnableUartClock'

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/Utilities/fsl_debug_console.c:157: undefined reference to `CLOCK_SYS_GetUartFreq'

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/Utilities/fsl_debug_console.c:160: undefined reference to `UART_HAL_SetBaudRate'

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/Utilities/fsl_debug_console.c:162: undefined reference to `UART_HAL_SetParityMode'

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/Utilities/fsl_debug_console.c:250: undefined reference to `UART_HAL_SendDataPolling'

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/Utilities/fsl_debug_console.c:250: undefined reference to `UART_HAL_ReceiveDataPolling'

./Sources/Board/board.o: In function `BOARD_InitOsc0':

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/Board/board.c:127: undefined reference to `CLOCK_SYS_OscInit'

./Sources/Board/board.o: In function `BOARD_InitRtcOsc':

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/Board/board.c:144: undefined reference to `CLOCK_SYS_RtcOscInit'

./Sources/Board/board.o: In function `BOARD_ClockInit':

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/Board/board.c:166: undefined reference to `CLOCK_SYS_SetConfiguration'

./Sources/main.o: In function `main':

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/main.c:11: undefined reference to `CLOCK_SYS_EnablePortClock'

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/main.c:12: undefined reference to `CLOCK_SYS_EnablePortClock'

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/main.c:13: undefined reference to `CLOCK_SYS_EnablePortClock'

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/main.c:14: undefined reference to `CLOCK_SYS_EnablePortClock'

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/main.c:25: undefined reference to `GPIO_DRV_Init'

./Sources/main.o: In function `PORTC_IRQHandler':

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/main.c:43: undefined reference to `GPIO_DRV_ClearPinIntFlag'

C:\Users\SSpears\workspace2.kds\FRDM-K64F_HelloWorld\Debug/../Sources/main.c:44: undefined reference to `GPIO_DRV_TogglePinOutput'

 

I have built the library and added the paths as described.  I don't know what to check next.

 

My include paths:

"../Sources"

"C:\Freescale\KSDK_1.2.0\platform\osa\inc"

"C:\Freescale\KSDK_1.2.0\platform\drivers\inc"

"C:\Freescale\KSDK_1.2.0\platform\hal\inc"

"C:\Freescale\KSDK_1.2.0\platform\system\inc"

"../Sources/Board"

"../Sources/Utilities"

"../Project_Settings/Startup_Code"

"../SDK/platform/CMSIS/Include"

"../SDK/platform/devices"

"../SDK/platform/devices/MK64F12/include"

"${PROJECT_KSDK_PATH}/platform/utilities/inc"

"${PROJECT_KSDK_PATH}/platform/utilities/src"

 

Library path:

"C:\Freescale\KSDK_1.2.0\lib\ksdk_platform_lib\kds\K64F12\debug"

"${ProjDirPath}/Project_Settings/Linker_Files"

 

Library:

ksdk_platform

Labels (1)
0 Kudos
1 Solution
916 Views
stephenspears
Contributor II

This is finally resolved.  The library file libksdk_platform.a was not building correctly.  The file size was around 50K and it should have been 2.1M.  I reinstalled the KSDK 1.2.0 Mainline file and now it builds correctly.  The library file is now the correct size and all errors are gone.

Stephen

View solution in original post

0 Kudos
5 Replies
917 Views
stephenspears
Contributor II

This is finally resolved.  The library file libksdk_platform.a was not building correctly.  The file size was around 50K and it should have been 2.1M.  I reinstalled the KSDK 1.2.0 Mainline file and now it builds correctly.  The library file is now the correct size and all errors are gone.

Stephen

0 Kudos
916 Views
stephenspears
Contributor II

I thought this was fixed by checking the Reference box (see above) but that has created a new error.  When I checked that box it added a library and library path.  There doesn't seem to be a library there as it throws the error below.

'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"C:\Freescale\KSDK_1.2.0\lib\ksdk_platform_lib\kds\K64F12" -L"C:\Freescale\KSDK_1.2.0\lib\ksdk_platform_lib\kds\K64F12\debug" -L"C:/Users/SSpears/workspace2.kds/FRDM-K64F_HelloWorld/Project_Settings/Linker_Files" -Wl,-Map,"FRDM-K64F_HelloWorld.map" -specs=nosys.specs -specs=nano.specs -o "FRDM-K64F_HelloWorld.elf"  ./Sources/Utilities/fsl_debug_console.o  ./Sources/Board/board.o ./Sources/Board/gpio_pins.o ./Sources/Board/pin_mux.o  ./Sources/main.o  ./Project_Settings/Startup_Code/startup.o ./Project_Settings/Startup_Code/startup_MK64F12.o ./Project_Settings/Startup_Code/system_MK64F12.o   -llibtemplatestatic -l"ksdk_platform"

c:/freescale/kds_3.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: cannot find -llibtemplatestatic

0 Kudos
916 Views
EarlOrlando
Senior Contributor II

Stephen,

Please follow this guide, it is based in the another that I think you used but it has more resumed steps. The document is focused in the FRDM-KL25Z just be sure that you use the correct folders for the FRDM-K64F.

If the problems persists please let me know.

Best regards,

Earl.

916 Views
EarlOrlando
Senior Contributor II

Hello Stephen,

Do the Board and Utilities folders contain all the files as is shown below?

pastedImage_0.png

Best regards,

Earl.

0 Kudos
916 Views
stephenspears
Contributor II

Hi Earl,

Yes, I have all of the correct files.  I managed to figure out the problem.  All of the check boxes under References below were empty.  I selected debug as shown below and those errors cleared.

Regards,

Stephen

ksdk_platform_lib.png

0 Kudos