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

Linking ble_app undefined reference to ...

HEllo,

I am facing and issue with undefined references for the linker. The compiler is able to compile, but I get linker errors like these

.../pca10040/s132/arm4/_build/ble_app_hrs_pca10040_s132.elf does not exist.Generating linker script ‘ble_app_hrs_pca10040_s132.ld’ Linking ble_app_hrs_pca10040_s132.elf

Output/ble_app_hrs_pca10040_s132 nrf52832_xxaa/Obj/d_batt_meas.o: In functionsaadc_event_handler_interrupt':undefined reference toapp_sched_event_put'

Output/ble_app_hrs_pca10040_s132 nrf52832_xxaa/Obj/d_batt_meas.o: In functionm_batt_meas_init': undefined reference togpiote_init'

Build failed

The weird thing is that the indexer can find such a functions/methods but the linker not. I have the files nrf_drv_saadc.c and nrf_dvr_gpiote.c under my directory folder drivers as can be seen here

image description

What am I doing wrong?

Parents
  • Check that the c files don't have #ifdef etc, at the top.

    Nordic use, what I find a strange system, where sdk_config.h is used to turn on or off, which functional blocks or services that get built into your application.

    I have not noticed this with timers, it it is definitely used for the common services, and thinks like the WDT

    So.. Look in sdk_config.h and see if you need to enable this feature.

    PS. I really wish Nordic did not do this think with sdk_config.h ;-)

Reply
  • Check that the c files don't have #ifdef etc, at the top.

    Nordic use, what I find a strange system, where sdk_config.h is used to turn on or off, which functional blocks or services that get built into your application.

    I have not noticed this with timers, it it is definitely used for the common services, and thinks like the WDT

    So.. Look in sdk_config.h and see if you need to enable this feature.

    PS. I really wish Nordic did not do this think with sdk_config.h ;-)

Children
Related