Combine Qorvo examples with Nordic examples

Hello,

i have a Nordic nRF52840DK and a Qorvo DWS3000 combination.
I´m using SDK7.0.2, Segger Embedded Studio 5.10a and J-Link 7.58b.

I want to combine the ble_app_uart_c_pca10056_s140 (Nordic example) with the ds_twr_responder (Deca example) to send the measured distance to another Board via BLE.

Both examples worked fine.
I used the ble_app_uart_c_pca10056_s140 as basis and add the code from the ds_twr_responder.c into the main.c from ble_app_uart_c_pca10056_s140 and added the necessary files and paths to the Project.

If i try to Build the Project it runs through 74 of 74 an then i get 69 Errors.
“Undefined reference” from references which worked properly before adding the code from ds_twr_responder.

Why does adding code erase the definitions?

Are there any experiences with combining Nordic and Qorvo examples?

Please Help :slight_smile:

Building ‘ble_app_uart_c_pca10056_s140’ from solution ‘ble_app_uart_c_pca10056_s140’ in configuration ‘Release’
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/thumb_crt0.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_log_backend_rtt.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_log_backend_serial.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_log_default_backends.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_log_frontend.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_log_str_formatter.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/app_button.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/app_error.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/app_error_handler_gcc.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/app_error_weak.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/app_fifo.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/app_scheduler.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/app_timer2.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/app_uart_fifo.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/app_util_platform.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/drv_rtc.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/hardfault_implementation.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_assert.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_atfifo.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_atomic.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_balloc.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_fprintf.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_fprintf_format.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_memobj.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_pwr_mgmt.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_queue.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_ringbuf.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_section_iter.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_sortlist.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_strerror.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/retarget.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/ses_startup_nrf52840.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/ses_startup_nrf_common.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/system_nrf52840.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/boards.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_drv_clock.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_drv_uart.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrfx_atomic.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrfx_clock.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrfx_gpiote.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrfx_prs.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrfx_uart.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrfx_uarte.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/bsp.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/bsp_btn_ble.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/SEGGER_RTT.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/SEGGER_RTT_Syscalls_SES.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/SEGGER_RTT_printf.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/ble_advdata.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/ble_db_discovery.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/ble_srv_common.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_ble_gatt.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_ble_gq.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_ble_scan.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/utf.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/ble_nus_c.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_sdh.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_sdh_ble.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_sdh_soc.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/shared_functions.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/deca_mutex.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/deca_probe_interface.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/deca_sleep.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/deca_spi.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/port.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_drv_spi.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrfx_spi.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrfx_spim.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/config_options.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/mac_802_15_4.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/mac_802_15_8.o’ is up to date
‘Output/Release/Obj/ble_app_uart_c_pca10056_s140/example_info.o’ is up to date
Output/Release/Exe/ble_app_uart_c_pca10056_s140.elf does not exist.
Linking ble_app_uart_c_pca10056_s140.elf
Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o: in function db_disc_handler': undefined reference to ble_nus_c_on_db_disc_evt’
Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o: in function ble_evt_handler': undefined reference to ble_nus_c_handles_assign’
Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o: in function uart_event_handle': undefined reference to ble_nus_c_string_send’
Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o: in function bsp_event_handler': undefined reference to nrf_pwr_mgmt_shutdown’
Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o: in function ble_nus_c_evt_handler': undefined reference to ble_nus_c_handles_assign’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:405: undefined reference to ble_nus_c_tx_notif_enable' Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o: in function ble_nus_chars_received_uart_print’:
undefined reference to ble_nus_c_string_send' Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o: in function power_management_init’:
undefined reference to nrf_pwr_mgmt_init' Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o: in function nus_c_init’:
undefined reference to ble_nus_c_init' Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o: in function idle_state_handle’:
undefined reference to nrf_pwr_mgmt_run' Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o: in function main’:
undefined reference to dwt_probe' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:793: undefined reference to dwt_checkidlerc’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:795: undefined reference to dwt_initialise' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:803: undefined reference to dwt_configure’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:810: undefined reference to dwt_configuretxrf' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:813: undefined reference to dwt_setrxantennadelay’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:814: undefined reference to dwt_settxantennadelay' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:819: undefined reference to dwt_setleds’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:824: undefined reference to dwt_setpreambledetecttimeout' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:826: undefined reference to dwt_setrxtimeout’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:829: undefined reference to dwt_rxenable' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:839: undefined reference to dwt_writesysstatuslo’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:842: undefined reference to dwt_getframelength' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:845: undefined reference to dwt_readrxdata’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:861: undefined reference to dwt_setdelayedtrxtime' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:864: undefined reference to dwt_setrxaftertxdelay’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:865: undefined reference to dwt_setrxtimeout' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:867: undefined reference to dwt_setpreambledetecttimeout’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:871: undefined reference to dwt_writetxdata' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:872: undefined reference to dwt_writetxfctrl’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:873: undefined reference to dwt_starttx' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:890: undefined reference to dwt_writesysstatuslo’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:893: undefined reference to dwt_getframelength' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:896: undefined reference to dwt_readrxdata’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:933: undefined reference to ble_nus_c_string_send' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:945: undefined reference to dwt_writesysstatuslo’
Output/Release/Obj/ble_app_uart_c_pca10056_s140/main.o:C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\examples\ble_central\ble_app_uart_c/main.c:70: undefined reference to ble_nus_c_on_ble_evt' Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_ble_gq.o: in function queues_purge’:
undefined reference to nrf_queue_generic_pop' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\components\ble\nrf_ble_gq/nrf_ble_gq.c:322: undefined reference to nrf_queue_generic_pop’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\components\ble\nrf_ble_gq/nrf_ble_gq.c:325: undefined reference to nrf_queue_generic_pop' Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_ble_gq.o: in function queue_process’:
undefined reference to nrf_queue_generic_pop' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\components\ble\nrf_ble_gq/nrf_ble_gq.c:283: undefined reference to nrf_queue_generic_pop’
Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_ble_gq.o: in function nrf_ble_gq_item_add': undefined reference to nrf_queue_is_empty’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\components\ble\nrf_ble_gq/nrf_ble_gq.c:517: undefined reference to nrf_queue_push' Output/Release/Obj/ble_app_uart_c_pca10056_s140/nrf_ble_gq.o: in function nrf_ble_gq_on_ble_evt’:
undefined reference to nrf_queue_push' Output/Release/Obj/ble_app_uart_c_pca10056_s140/shared_functions.o: in function get_tx_timestamp_u64’:
undefined reference to dwt_readtxtimestamp' Output/Release/Obj/ble_app_uart_c_pca10056_s140/shared_functions.o: in function get_rx_timestamp_u64’:
undefined reference to dwt_readrxtimestamp' Output/Release/Obj/ble_app_uart_c_pca10056_s140/shared_functions.o: in function waitforsysstatus’:
undefined reference to dwt_readsysstatushi' C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\Src\examples\shared_data/shared_functions.c:597: undefined reference to dwt_readsysstatuslo’
C:\DW3xxx_XR6.0C_24Feb2022\Release_XR6.0C\Software\DW3XXX_API\Sources\DW3XXX_API_rev9p3\DW3XXX_API_rev9p3\API\Src\examples\shared_data/shared_functions.c:603: undefined reference to dwt_readsysstatushi' Output/Release/Obj/ble_app_uart_c_pca10056_s140/example_info.o: in function build_examples’:
undefined reference to `ds_twr_responder’
Build failed

Those are linker errors rather than compiler errors.
The most likely cause is that your library path or list of libraries to include is incorrect, you have all the libraries from both projects included in your linker command?

Thanks for the fast reply.

Yes, all library paths are included. I just copied the directories from one project into the other and deleted the double.

I started the Project, once, with a newer version of Segger Embedded Studio (6.34a). Is it possible, that this could cause such porblems, maybe the newer version changed some paths in the Project, in the background?

I really dont have any other ideas.

You are showing me the preprocessor directories there. A missing entry there would be a compile error not a linker error.
Look at the item above that on the left where is says linker.

Okay thanks, now i get what you meant.
So i have to add the library paths in here?

Can you tell me where exactly?

I’ve never used those tools or examples so I can’t tell you what exactly you need to add.

The c complier builds each c / c++ file into a single .o object file.

The linker then takes all of those .o files and any additional libraries used and combines them into one executable. When calling a function in another file the compiler puts in a placeholder, the linker joins everything together and then replaces these placeholders with the correct memory address in the combined file. The error you are getting is that while trying to do this it is finding calls to functions that aren’t anywhere in the combined file.

This is normally caused by one of two things: 1) Declaring a function in a header but then never defining its body in a .c / .cpp file or 2) including the header for a pre-compiled library in your .c or .h files but then not including the library in the linkers additional includes section.

Since you say all of your code builds before you combine the projects and the missing functions are things like “nrf_queue_generic_pop” then cause 1 is unlikely and it’s almost certainly cause 2.

So look at the two individual projects under Linker → Additional input files and possibly under the Library and Libraries headings on the left and check that your combined project is including any libraries mentioned there. You’re probably looking for something involving .lib files but since I’m not familiar with the nordic tools don’t assume that’s correct.