This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Linker issue in SDK15.2

I am following this tutorial:

https://devzone.nordicsemi.com/nordic/short-range-guides/b/software-development-kit/posts/application-timer-tutorial?CommentId=43347679-22d9-4d45-ad73-4632d06c5e3e

But when I compile I ran into this issue where

1> Linking app_timer_tutorial_pca10056.elf
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.16/gcc/arm-none-eabi/bin/ld: Output/app_timer_tutorial_pca10056 Release/Obj/main.o: in function `main':
1> D:\Current Work\BLE\nRF5_SDK_15.2.0_9412b96\examples\peripheral\nrf5-application-timer-tutorial/main.c:150: undefined reference to `app_timer_init'
Build failed

It appears to be a linker issue. I have done the necessary includes and the changes to the sdk_config.h file but this error still pops up.

Parents
  • Thank you for the fast response!

    I have indeed missed the app_timer.c inclusion, and I noticed it was also included in the tutorial. Parts 2 and 3 I have checked and are done. However, once I included the file I ran into another issue:

    Building ‘app_timer_tutorial_pca10056’ from solution ‘app_timer_tutorial_pca10056’ in configuration ‘Release’
    1> Compiling ‘app_timer.c’
    2> Compiling ‘main.c’
    1> In file included from ../../../../../../components/libraries/util/sdk_common.h:57,
    1>                  from D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:40:
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:32: error: 'SWIAPP_TIMER_CONFIG_SWI_NUMBER_EGUAPP_TIMER_CONFIG_SWI_NUMBER_IRQn' undeclared (first use in this function)
    1> ../../../../../../components/libraries/util/nordic_common.h:137:31: note: in definition of macro 'CONCAT_3_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:24: note: in expansion of macro 'CONCAT_3'
    1> ../../../../../../components/libraries/util/nordic_common.h:116:31: note: in expansion of macro 'CONCAT_2_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:23: note: in expansion of macro 'CONCAT_2'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:33: note: in expansion of macro 'SWI_PART'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:78:18: note: in expansion of macro 'SWI_IRQ_n'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:365:24: note: in expansion of macro 'SWI_IRQn'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:32: note: each undeclared identifier is reported only once for each function it appears in
    1> ../../../../../../components/libraries/util/nordic_common.h:137:31: note: in definition of macro 'CONCAT_3_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:24: note: in expansion of macro 'CONCAT_3'
    1> ../../../../../../components/libraries/util/nordic_common.h:116:31: note: in expansion of macro 'CONCAT_2_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:23: note: in expansion of macro 'CONCAT_2'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:33: note: in expansion of macro 'SWI_PART'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:78:18: note: in expansion of macro 'SWI_IRQ_n'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:365:24: note: in expansion of macro 'SWI_IRQn'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:32: error: 'SWIAPP_TIMER_CONFIG_SWI_NUMBER_EGUAPP_TIMER_CONFIG_SWI_NUMBER_IRQn' undeclared (first use in this function); did you mean 'SWIAPP_TIMER_CONFIG_SWI_NUMBER_EGUAPP_TIMER_CONFIG_SWI_NUMBER_IRQHandler'?
    1> ../../../../../../components/libraries/util/nordic_common.h:137:31: note: in definition of macro 'CONCAT_3_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:24: note: in expansion of macro 'CONCAT_3'
    1> ../../../../../../components/libraries/util/nordic_common.h:116:31: note: in expansion of macro 'CONCAT_2_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:23: note: in expansion of macro 'CONCAT_2'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:33: note: in expansion of macro 'SWI_PART'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:78:18: note: in expansion of macro 'SWI_IRQ_n'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:949:26: note: in expansion of macro 'SWI_IRQn'
    Build failed
    

Reply
  • Thank you for the fast response!

    I have indeed missed the app_timer.c inclusion, and I noticed it was also included in the tutorial. Parts 2 and 3 I have checked and are done. However, once I included the file I ran into another issue:

    Building ‘app_timer_tutorial_pca10056’ from solution ‘app_timer_tutorial_pca10056’ in configuration ‘Release’
    1> Compiling ‘app_timer.c’
    2> Compiling ‘main.c’
    1> In file included from ../../../../../../components/libraries/util/sdk_common.h:57,
    1>                  from D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:40:
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:32: error: 'SWIAPP_TIMER_CONFIG_SWI_NUMBER_EGUAPP_TIMER_CONFIG_SWI_NUMBER_IRQn' undeclared (first use in this function)
    1> ../../../../../../components/libraries/util/nordic_common.h:137:31: note: in definition of macro 'CONCAT_3_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:24: note: in expansion of macro 'CONCAT_3'
    1> ../../../../../../components/libraries/util/nordic_common.h:116:31: note: in expansion of macro 'CONCAT_2_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:23: note: in expansion of macro 'CONCAT_2'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:33: note: in expansion of macro 'SWI_PART'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:78:18: note: in expansion of macro 'SWI_IRQ_n'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:365:24: note: in expansion of macro 'SWI_IRQn'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:32: note: each undeclared identifier is reported only once for each function it appears in
    1> ../../../../../../components/libraries/util/nordic_common.h:137:31: note: in definition of macro 'CONCAT_3_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:24: note: in expansion of macro 'CONCAT_3'
    1> ../../../../../../components/libraries/util/nordic_common.h:116:31: note: in expansion of macro 'CONCAT_2_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:23: note: in expansion of macro 'CONCAT_2'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:33: note: in expansion of macro 'SWI_PART'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:78:18: note: in expansion of macro 'SWI_IRQ_n'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:365:24: note: in expansion of macro 'SWI_IRQn'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:32: error: 'SWIAPP_TIMER_CONFIG_SWI_NUMBER_EGUAPP_TIMER_CONFIG_SWI_NUMBER_IRQn' undeclared (first use in this function); did you mean 'SWIAPP_TIMER_CONFIG_SWI_NUMBER_EGUAPP_TIMER_CONFIG_SWI_NUMBER_IRQHandler'?
    1> ../../../../../../components/libraries/util/nordic_common.h:137:31: note: in definition of macro 'CONCAT_3_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:24: note: in expansion of macro 'CONCAT_3'
    1> ../../../../../../components/libraries/util/nordic_common.h:116:31: note: in expansion of macro 'CONCAT_2_'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:69:23: note: in expansion of macro 'CONCAT_2'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:71:33: note: in expansion of macro 'SWI_PART'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:78:18: note: in expansion of macro 'SWI_IRQ_n'
    1> D:\Current Work\BLE\nRF5_SDK_for_Thread\components\libraries\timer\app_timer.c:949:26: note: in expansion of macro 'SWI_IRQn'
    Build failed
    

Children
Related