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

undefined reference to `nrf_libuarte_async_tx'

Hello, I'm trying to compile the LIBUARTE example from SDK 16 but im getting undefined reference errors, this is what I've done so far:

  1. in sdk_config.h defined
    NRF_LIBUARTE_DRV_UARTE0
    , (I've also copied the config file provided in the example folder).
  2. Included in the main.cpp file 
    "nrf_libuarte_async.h"
  3. Included to the project the corresponding source files and include directories from "SDK_ROOT/components/libraries/libuarte"

This is the console output:

c:/progra~2/gnutoo~1/92019-~1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/example.dir/main.cpp.obj: in function `libuarte_rtc_handler(nrfx_rtc_int_type_t)':
C:\Nordic\Uart_test2\src/main.cpp:28: undefined reference to `nrf_libuarte_async_timeout_handler(nrf_libuarte_async_t const*)'
c:/progra~2/gnutoo~1/92019-~1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/example.dir/main.cpp.obj: in function `uart_event_handler(void*, nrf_libuarte_async_evt_t*)':
C:\Nordic\Uart_test2\src/main.cpp:52: undefined reference to `nrf_libuarte_async_tx(nrf_libuarte_async_t const*, unsigned char*, unsigned int)'
c:/progra~2/gnutoo~1/92019-~1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Nordic\Uart_test2\src/main.cpp:73: undefined reference to `nrf_libuarte_async_rx_free(nrf_libuarte_async_t const*, unsigned char*, unsigned int)'
c:/progra~2/gnutoo~1/92019-~1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Nordic\Uart_test2\src/main.cpp:79: undefined reference to `nrf_libuarte_async_tx(nrf_libuarte_async_t const*, unsigned char*, unsigned int)'
c:/progra~2/gnutoo~1/92019-~1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/example.dir/main.cpp.obj: in function `main':
C:\Nordic\Uart_test2\src/main.cpp:121: undefined reference to `nrf_libuarte_async_init(nrf_libuarte_async_t const*, nrf_libuarte_async_config_t const*, void (*)(void*, nrf_libuarte_async_evt_t*), void*)'
c:/progra~2/gnutoo~1/92019-~1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Nordic\Uart_test2\src/main.cpp:125: undefined reference to `nrf_libuarte_async_enable(nrf_libuarte_async_t const*)'
c:/progra~2/gnutoo~1/92019-~1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Nordic\Uart_test2\src/main.cpp:127: undefined reference to `nrf_libuarte_async_tx(nrf_libuarte_async_t const*, unsigned char*, unsigned int)'
c:/progra~2/gnutoo~1/92019-~1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Nordic\Uart_test2\src/main.cpp:132: undefined reference to `nrf_libuarte_async_tx(nrf_libuarte_async_t const*, unsigned char*, unsigned int)'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: *** [src\CMakeFiles\example.dir\build.make:815: src/example.elf] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:350: src/CMakeFiles/example.dir/all] Error 2
mingw32-make.exe[2]: *** Waiting for unfinished jobs....

What am I missing? any thoughts?

Related