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

undefined reference to 'driver functions'

I am trying to use nrfx_timer and nrf_drv_ppi in Light switch server demo example. But I face undefined reference error.

I have add c files path and include in CMakeLists.txt(see attached).

set(target "ir_server_${PLATFORM}_${SOFTDEVICE}")

add_executable(${target}
    "${CMAKE_CURRENT_SOURCE_DIR}/src/main.c"
    "${CMAKE_CURRENT_SOURCE_DIR}/src/m_infrared/ir.c"
    "${CMAKE_SOURCE_DIR}/examples/common/src/app_onoff.c"
    "${CMAKE_SOURCE_DIR}/mesh/stack/src/mesh_stack.c"
    "${CMAKE_SOURCE_DIR}/examples/common/src/mesh_provisionee.c"
    "${MBTLE_SOURCE_DIR}/examples/common/src/rtt_input.c"
    "${CMAKE_SOURCE_DIR}/examples/common/src/simple_hal.c"
    "${CMAKE_SOURCE_DIR}/examples/common/src/mesh_app_utils.c"
    "${SDK_ROOT}/modules/nrfx/drivers/src/nrfx_timer.c"
    "${SDK_ROOT}/integration/nrfx/legacy/nrf_drv_ppi.c"
    ${BLE_SOFTDEVICE_SUPPORT_SOURCE_FILES}
    ${WEAK_SOURCE_FILES}
    ${MESH_CORE_SOURCE_FILES}
    ${MESH_BEARER_SOURCE_FILES}
    ${MESH_GATT_SOURCE_FILES}
    ${CONFIG_SERVER_SOURCE_FILES}
    ${HEALTH_SERVER_SOURCE_FILES}
    ${GENERIC_ONOFF_SERVER_SOURCE_FILES}
    ${ACCESS_SOURCE_FILES}
    ${MESH_APP_TIMER_SOURCE_FILES}
    ${PROV_PROVISIONEE_SOURCE_FILES}
    ${PROV_COMMON_SOURCE_FILES}
    ${PROV_BEARER_ADV_SOURCE_FILES}
    ${PROV_BEARER_GATT_SOURCE_FILES}
    ${${PLATFORM}_SOURCE_FILES}
    ${${nRF5_SDK_VERSION}_SOURCE_FILES})

target_include_directories(${target} PUBLIC
    "${SDK_ROOT}/integration/nrfx/legacy"
    "${SDK_ROOT}/modules/nrfx/drivers/include"
    "${CMAKE_CURRENT_SOURCE_DIR}/include"
    "${CMAKE_CURRENT_SOURCE_DIR}/src/m_infrared"
    "${CMAKE_CURRENT_SOURCE_DIR}/../include"
    "${CMAKE_SOURCE_DIR}/examples/common/include"
    "${CMAKE_SOURCE_DIR}/external/rtt/include"
    ${BLE_SOFTDEVICE_SUPPORT_INCLUDE_DIRS}
    ${CONFIG_SERVER_INCLUDE_DIRS}
    ${HEALTH_SERVER_INCLUDE_DIRS}
    ${GENERIC_ONOFF_SERVER_INCLUDE_DIRS}
    ${MESH_INCLUDE_DIRS}
    ${${SOFTDEVICE}_INCLUDE_DIRS}
    ${${PLATFORM}_INCLUDE_DIRS}
    ${${BOARD}_INCLUDE_DIRS}
    ${${nRF5_SDK_VERSION}_INCLUDE_DIRS})

set_target_link_options(${target}
    ${CMAKE_CURRENT_SOURCE_DIR}/linker/${PLATFORM}_${SOFTDEVICE})

target_compile_options(${target} PUBLIC
    ${${ARCH}_DEFINES})

target_compile_definitions(${target} PUBLIC
    ${USER_DEFINITIONS}
    -DUSE_APP_CONFIG
    -DCONFIG_APP_IN_CORE
    ${${PLATFORM}_DEFINES}
    ${${SOFTDEVICE}_DEFINES}
    ${${BOARD}_DEFINES})

target_link_libraries(${target}
    rtt_${PLATFORM}
    uECC_${PLATFORM})

create_hex(${target})
add_flash_target(${target})

get_property(target_include_dirs TARGET ${target} PROPERTY INCLUDE_DIRECTORIES)
add_pc_lint(${target}
    "${CMAKE_CURRENT_SOURCE_DIR}/src/main.c;${CMAKE_SOURCE_DIR}/examples/common/src/app_onoff.c"
    "${target_include_dirs}"
    "${${PLATFORM}_DEFINES};${${SOFTDEVICE}_DEFINES};${${BOARD}_DEFINES}")
add_ses_project(${target})

What am I missing setting for this integrate?

Thanks,

build log:


D:\workplace\mesh\nrf5_sdk_for_mesh\build>ninja ir_server_nrf52832_xxAA_s132_6.1.0
[120/120] Linking C executable examples\ir\server\ir_server_nrf52832_xxAA_s132_6.1.0.elf
FAILED: examples/ir/server/ir_server_nrf52832_xxAA_s132_6.1.0.elf examples/ir/server/ir_server_nrf52832_xxAA_s132_6.1.0.hex
cmd.exe /C "cd . && C:\PROGRA~2\GNUTOO~1\62017-~1\bin\AR19DD~1.EXE --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Og -g3 -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -L"D:/workplace/mesh/nrf5_sdk_for_mesh/../nRF5_SDK_15.2.0_9412b96/modules/nrfx/mdk" "-LD:/workplace/mesh/nrf5_sdk_for_mesh/examples/ir/server/linker" -Xlinker -Map="D:/workplace/mesh/nrf5_sdk_for_mesh/build/examples/ir/server/ir_server_nrf52832_xxAA_s132_6.1.0.map" -T"D:/workplace/mesh/nrf5_sdk_for_mesh/examples/ir/server/linker/nrf52832_xxAA_s132_6.1.0.ld" @CMakeFiles\ir_server_nrf52832_xxAA_s132_6.1.0.rsp -o examples\ir\server\ir_server_nrf52832_xxAA_s132_6.1.0.elf && cmd.exe /C "cd /D D:\workplace\mesh\nrf5_sdk_for_mesh\build\examples\ir\server && arm-none-eabi-objcopy -O ihex D:/workplace/mesh/nrf5_sdk_for_mesh/build/examples/ir/server/ir_server_nrf52832_xxAA_s132_6.1.0.elf D:/workplace/mesh/nrf5_sdk_for_mesh/build/examples/ir/server/ir_server_nrf52832_xxAA_s132_6.1.0.hex && cd /D D:\workplace\mesh\nrf5_sdk_for_mesh\build\examples\ir\server && arm-none-eabi-size D:/workplace/mesh/nrf5_sdk_for_mesh/build/examples/ir/server/ir_server_nrf52832_xxAA_s132_6.1.0.elf""
examples/ir/server/CMakeFiles/ir_server_nrf52832_xxAA_s132_6.1.0.dir/src/m_infrared/ir.c.obj: In function `emit_ir':
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:68: undefined reference to `nrfx_timer_clear'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:70: undefined reference to `nrfx_timer_clear'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:71: undefined reference to `nrfx_timer_resume'
examples/ir/server/CMakeFiles/ir_server_nrf52832_xxAA_s132_6.1.0.dir/src/m_infrared/ir.c.obj: In function `ir_gpio_init':
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:155: undefined reference to `nrfx_gpiote_is_init'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:165: undefined reference to `nrfx_gpiote_out_init'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:167: undefined reference to `nrfx_gpiote_out_task_enable'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:158: undefined reference to `nrfx_gpiote_init'
examples/ir/server/CMakeFiles/ir_server_nrf52832_xxAA_s132_6.1.0.dir/src/m_infrared/ir.c.obj: In function `timer1_init':
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:390: undefined reference to `nrfx_timer_init'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:393: undefined reference to `nrfx_timer_extended_compare'
examples/ir/server/CMakeFiles/ir_server_nrf52832_xxAA_s132_6.1.0.dir/src/m_infrared/ir.c.obj: In function `timer3_init':
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:444: undefined reference to `nrfx_timer_init'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:449: undefined reference to `nrfx_timer_extended_compare'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:458: undefined reference to `nrfx_timer_compare'
examples/ir/server/CMakeFiles/ir_server_nrf52832_xxAA_s132_6.1.0.dir/src/m_infrared/ir.c.obj: In function `timer4_init':
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:470: undefined reference to `nrfx_timer_init'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:478: undefined reference to `nrfx_timer_compare'
examples/ir/server/CMakeFiles/ir_server_nrf52832_xxAA_s132_6.1.0.dir/src/m_infrared/ir.c.obj: In function `ppi_init':
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:194: undefined reference to `nrfx_ppi_channel_alloc'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:197: undefined reference to `nrfx_gpiote_out_task_addr_get'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:197: undefined reference to `nrfx_ppi_channel_assign'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:210: undefined reference to `nrfx_ppi_channel_alloc'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:222: undefined reference to `nrfx_ppi_channel_fork_assign'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:243: undefined reference to `nrfx_ppi_channel_alloc'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:246: undefined reference to `nrfx_ppi_channel_assign'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:262: undefined reference to `nrfx_ppi_channel_alloc'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:275: undefined reference to `nrfx_ppi_channel_alloc'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:279: undefined reference to `nrfx_ppi_channel_assign'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:288: undefined reference to `nrfx_ppi_channel_alloc'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:300: undefined reference to `nrfx_ppi_channel_fork_assign'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:306: undefined reference to `nrfx_ppi_channel_alloc'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:310: undefined reference to `nrfx_ppi_channel_assign'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:336: undefined reference to `nrfx_ppi_channel_enable'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:339: undefined reference to `nrfx_ppi_channel_enable'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:342: undefined reference to `nrfx_ppi_channel_enable'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:345: undefined reference to `nrfx_ppi_channel_enable'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:348: undefined reference to `nrfx_ppi_channel_enable'
examples/ir/server/CMakeFiles/ir_server_nrf52832_xxAA_s132_6.1.0.dir/src/m_infrared/ir.c.obj:D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:351: more undefined references to `nrfx_ppi_channel_enable' follow
examples/ir/server/CMakeFiles/ir_server_nrf52832_xxAA_s132_6.1.0.dir/src/m_infrared/ir.c.obj: In function `ir_init':
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:900: undefined reference to `nrfx_timer_enable'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:901: undefined reference to `nrfx_timer_pause'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:907: undefined reference to `nrfx_timer_enable'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:908: undefined reference to `nrfx_timer_clear'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:910: undefined reference to `nrfx_timer_enable'
D:\workplace\mesh\nrf5_sdk_for_mesh\build/../examples/ir/server/src/m_infrared/ir.c:911: undefined reference to `nrfx_timer_pause'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

D:\workplace\mesh\nrf5_sdk_for_mesh\build>

build tool:

CMAKE, Ninja

development software, with versions (SDKs, IDEs, SoftDevices, ...)

SDK: nrf5_SDK_for_Mesh_v310, nRF5_SDK_15.2.0_9412b96

Computer platform, with versions (Windows/Linux/OSX, ...)

win10

hardware revisions (chip build codes, board revisions, ...)

PCA10040

Parents Reply Children
No Data
Related