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

Combining examples in SDK13

Hello,

I have a problem while combining peripheral examples in SDK13. I am trying to combine twi_sensor and uart but when I do this in uart folder, compiler gives following error:

> Linking target: _build/nrf52832_xxaa.out

> _build/nrf52832_xxaa_main.c.o: In function `twi_init':

> /home/alpay/Desktop/nrf5sdk13/examples/peripheral/uart/pca10040/blank/armgcc/../../../main.c:167: undefined reference to `nrf_drv_twi_init'

> /home/alpay/Desktop/nrf5sdk13/examples/peripheral/uart/pca10040/blank/armgcc/../../../main.c:170: undefined reference to `nrf_drv_twi_enable'
_build/nrf52832_xxaa_main.c.o: In function `read_sensor_data':

> /home/alpay/Desktop/nrf5sdk13/examples/peripheral/uart/pca10040/blank/armgcc/../../../main.c:178: undefined reference to `nrf_drv_twi_rx'
collect2: error: ld returned 1 exit status

> ../../../../../../components/toolchain/gcc/Makefile.common:153: recipe for target '_build/nrf52832_xxaa.out' failed

and when I try to do it in twi_sensor folder:

> _build/nrf52832_xxaa_main.c.o: In function `uart_event_handle':
/home/alpay/Desktop/nrf5sdk13/examples/peripheral/uart-twi/pca10040/blank/armgcc/../../../main.c:84: undefined reference to `app_uart_get'

>_build/nrf52832_xxaa_main.c.o: In function `uart_init':
/home/alpay/Desktop/nrf5sdk13/examples/peripheral/uart-twi/pca10040/blank/armgcc/../../../main.c:130: undefined reference to `app_uart_init'
collect2: error: ld returned 1 exit status

>../../../../../../components/toolchain/gcc/Makefile.common:153: recipe for target '_build/nrf52832_xxaa.out' failed
make: *** [_build/nrf52832_xxaa.out] Error 1

Obviously there is a linking problem. And I am using same makefiles includes all the necessary source files and libraries.

Thank you for your help!

Related