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

Trying to combine BLE Central UART with NFC URI examples

This is a beginner question and may well related to a misplaced setting in Segger Embedded Studio.

I am working towards a BLE scanner application which will include NFC tag capability.

To start me off I copied the NFC code from the record_url example and pasted this into the ble_app_uart_c example.

I updated my compile options to include the NFC libararies etc.

However, when building I am getting these errors saying " undefined reference to" etc.

I cannot work out what's the cause as I have checked all my references with the original project and they appear to match. Maybe I missed something.

Thanks

[code]

Building 'ble_app_###_pca10040_s132' from solution 'ble_app_###_pca10040_s132' in configuration 'Release'
  Assembling 'thumb_crt0.s'
  Compiling 'bsp_btn_ble.c'
  Compiling 'bsp.c'
  Compiling 'nrf_hw_backend_init.c'
  Compiling 'nrf_hw_backend_rng.c'
  Compiling 'nrf_hw_backend_rng_mbedtls.c'
  Compiling 'app_button.c'
  Compiling 'app_error_handler_gcc.c'
  Compiling 'app_error.c'
  Compiling 'app_timer2.c'
  Compiling 'app_scheduler.c'
  Compiling 'app_error_weak.c'
  Compiling 'app_util_platform.c'
  Compiling 'crc16.c'
  Compiling 'fds.c'
  Compiling 'drv_rtc.c'
  Compiling 'hardfault_implementation.c'
  Compiling 'mem_manager.c'
  Compiling 'nrf_assert.c'
  Compiling 'nrf_atfifo.c'
  Compiling 'nrf_atflags.c'
  Compiling 'nrf_atomic.c'
  Compiling 'nrf_balloc.c'
  Compiling 'nrf_fprintf.c'
  Compiling 'nrf_fstorage.c'
  Compiling 'nrf_fprintf_format.c'
  Compiling 'nrf_memobj.c'
  Compiling 'nrf_fstorage_sd.c'
  Compiling 'nrf_pwr_mgmt.c'
  Compiling 'nrf_queue.c'
  Compiling 'nrf_ringbuf.c'
  Compiling 'nrf_sortlist.c'
  Compiling 'nrf_section_iter.c'
  Compiling 'nrf_strerror.c'
  Compiling 'app_uart.c'
  Compiling 'nrf_drv_clock.c'
  Compiling 'nrf_drv_rng.c'
  Compiling 'nrf_drv_uart.c'
  Compiling 'nrfx_atomic.c'
  Compiling 'nrfx_clock.c'
  Compiling 'nrfx_gpiote.c'
  Compiling 'nrfx_prs.c'
  Compiling 'nrfx_uart.c'
  Compiling 'nrfx_rng.c'
  Compiling 'nrfx_uarte.c'
  Compiling 'boards.c'
  Compiling 'nrf_log_backend_serial.c'
  Compiling 'nrf_log_backend_rtt.c'
  Compiling 'nrf_log_backend_uart.c'
  Compiling 'nrf_log_default_backends.c'
  Compiling 'nrf_log_str_formatter.c'
  Compiling 'nrf_log_frontend.c'
  Compiling 'aes.c'
  Compiling 'ctr_drbg.c'
  Compiling 'platform_util.c'
  Compiling 'nrf_crypto_aead.c'
  Compiling 'nrf_crypto_aes.c'
  Compiling 'nrf_crypto_aes_shared.c'
  Compiling 'nrf_crypto_ecc.c'
  Compiling 'nrf_crypto_ecdh.c'
  Compiling 'nrf_crypto_ecdsa.c'
  Compiling 'nrf_crypto_eddsa.c'
  Compiling 'nrf_crypto_error.c'
  Compiling 'nrf_crypto_hash.c'
  Compiling 'nrf_crypto_hmac.c'
  Compiling 'nrf_crypto_hkdf.c'
  Compiling 'nrf_crypto_init.c'
  Compiling 'nrf_crypto_rng.c'
  Compiling 'nrf_crypto_shared.c'
  Compiling 'main.c'
  Compiling 'SEGGER_RTT.c'
  Compiling 'SEGGER_RTT_printf.c'
  Compiling 'SEGGER_RTT_Syscalls_SES.c'
  Assembling 'ses_startup_nrf52.s'
  Assembling 'ses_startup_nrf_common.s'
  Compiling 'auth_status_tracker.c'
  Compiling 'system_nrf52.c'
  Compiling 'ble_conn_state.c'
  Compiling 'ble_advdata.c'
  Compiling 'ble_db_discovery.c'
  Compiling 'ble_srv_common.c'
  Compiling 'gatt_cache_manager.c'
  Compiling 'gatts_cache_manager.c'
  Compiling 'nrf_ble_gatt.c'
  Compiling 'id_manager.c'
  Compiling 'nrf_ble_gq.c'
  Compiling 'nrf_ble_scan.c'
  Compiling 'nrf_ble_lesc.c'
  Compiling 'peer_data_storage.c'
  Compiling 'peer_database.c'
  Compiling 'peer_id.c'
  Compiling 'peer_manager.c'
  Compiling 'peer_manager_handler.c'
  Compiling 'pm_buffer.c'
  Compiling 'security_dispatcher.c'
  Compiling 'security_manager.c'
  Compiling 'utf.c'
  Compiling 'ble_bas_c.c'
  Compiling 'ble_hrs_c.c'
  Compiling 'nrf_sdh_ble.c'
  Compiling 'nrf_sdh.c'
  Compiling 'nrf_sdh_soc.c'
  Compiling 'oberon_backend_chacha_poly_aead.c'
  Compiling 'oberon_backend_ecc.c'
  Compiling 'oberon_backend_ecdh.c'
  Compiling 'oberon_backend_eddsa.c'
  Compiling 'oberon_backend_ecdsa.c'
  Compiling 'oberon_backend_hash.c'
  Compiling 'oberon_backend_hmac.c'
  Compiling 'nfc_ndef_msg.c'
  Compiling 'nfc_ndef_record.c'
  Compiling 'nfc_platform.c'
  Compiling 'nfc_uri_rec.c'
  Compiling 'nfc_uri_msg.c'
  Linking ble_app_###_pca10040_s132.elf
    Output/Release/Obj/ble_app_###_pca10040_s132/main.o: in function `update_NFCurl':
    undefined reference to `nfc_uri_msg_encode'
    ../../../../../../components/nfc/t2t_lib/nfc_t2t_lib_gcc.a(nfc_t2t_lib_al.c.o): in function `nrfx_nfct_evt_handler':
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:297: undefined reference to `nfc_platform_event_handler'
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:307: undefined reference to `nrfx_nfct_rx'
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:316: undefined reference to `nrfx_nfct_rx'
    ../../../../../../components/nfc/t2t_lib/nfc_t2t_lib_gcc.a(nfc_t2t_lib_al.c.o): in function `nrf_nfct_rx_frameend_handle':
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:252: undefined reference to `nrfx_nfct_init_substate_force'
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:277: undefined reference to `nrfx_nfct_rx'
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:285: undefined reference to `nrfx_nfct_init_substate_force'
    ../../../../../../components/nfc/t2t_lib/nfc_t2t_lib_gcc.a(nfc_t2t_lib_al.c.o): in function `nfc_t2t_lib_al_setup':
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:115: undefined reference to `nrfx_nfct_nfcid1_default_bytes_get'
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:123: undefined reference to `nfc_platform_setup'
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:129: undefined reference to `nrfx_nfct_init'
    ../../../../../../components/nfc/t2t_lib/nfc_t2t_lib_gcc.a(nfc_t2t_lib_al.c.o): in function `nfc_t2t_lib_al_start':
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:223: undefined reference to `nrfx_nfct_enable'
    ../../../../../../components/nfc/t2t_lib/nfc_t2t_lib_gcc.a(nfc_t2t_lib_al.c.o): in function `nfc_t2t_lib_al_send':
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:234: undefined reference to `nrfx_nfct_tx'
    ../../../../../../components/nfc/t2t_lib/nfc_t2t_lib_gcc.a(nfc_t2t_lib_al.c.o): in function `nfc_t2t_lib_al_stop':
    C:\nfc\nfc-library\private\nfc_t2t_lib\armgcc/../nfc_t2t_lib_al.c:239: undefined reference to `nrfx_nfct_disable'
Build failed

[/code]

Parents
  • I hadn't thought to check the sdk_config.h file. It appears there are quite a few NFC settings within this file that probably require a manual change. Other than 1 or 2 obvious "enable" flags I cannot figure what else to chance etc.

    I am thus also curious to know where I can find documentation about what changes impact what etc.

  • Hi,

    You may find some help by looking at the ble peripheral examples that enable nfc, such as ble_app_hrs_nfc_pairing and ble_hids_keyboard_nfc_pairing. Unfortunately I am not aware of any good lookup other than to look at the sdk_config.h and the usage of the define in the header/source files.

    Best regards,
    Kenneth

  • Thanks for the suggestion. Yes, I did notice that there are a couple of BLE central/NFC combo examples under the experimental folder inside BLE central examples. However, these go way beyond what I need as these deal with ble oob pairing and in some cases use t4t (tag type 4) library files.

    Also, I noticed that none of these examples use nfc_t2t_lib.

    The NFC record_url example does use nfc_t2t_lib.

    So, as soon as I include the necessary file, i.e. .../components/nfc/t2t_lib/nfc_t2t_lib_gcc.a then I get all these errors as in it cannot find the functions etc. within this file even though IDE's "intelli-sense" knows of functions etc.

    So something is not right.

Reply
  • Thanks for the suggestion. Yes, I did notice that there are a couple of BLE central/NFC combo examples under the experimental folder inside BLE central examples. However, these go way beyond what I need as these deal with ble oob pairing and in some cases use t4t (tag type 4) library files.

    Also, I noticed that none of these examples use nfc_t2t_lib.

    The NFC record_url example does use nfc_t2t_lib.

    So, as soon as I include the necessary file, i.e. .../components/nfc/t2t_lib/nfc_t2t_lib_gcc.a then I get all these errors as in it cannot find the functions etc. within this file even though IDE's "intelli-sense" knows of functions etc.

    So something is not right.

Children
Related