undefined reference to `bt_bap_base_get_pres_delay'

I now need to make a program on nrf5340 audio DK, SDK v3.0.2 to scan auracast and print the information in the subgroup in PA, without sink BIS.

In addition, it needs to be used as a unicast server so that the mobile phone can connect to DK and play music,

I can connect to my phone and play music using the C:\ncs\v3.0.2\nrf\applications\nrf5340_audio\src\bluetooth\bt_stream\unicast\unicast_server.c example,

So I added some config in overlay-unicast_server.conf,

#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_AUDIO_DEV=1

CONFIG_BT_GATT_AUTO_DISCOVER_CCC=y
CONFIG_BT_GATT_AUTO_RESUBSCRIBE=n
CONFIG_BT_GATT_AUTO_SEC_REQ=n
CONFIG_BT_GATT_AUTO_UPDATE_MTU=y
CONFIG_BT_GATT_CACHING=n
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_GATT_DYNAMIC_DB=y

CONFIG_BT_MAX_CONN=4
CONFIG_BT_MAX_PAIRED=4
CONFIG_BT_EXT_ADV=y

CONFIG_BT_AUDIO=y

CONFIG_BT_PERIPHERAL=y
CONFIG_BT_ISO_PERIPHERAL=y
CONFIG_BT_BAP_UNICAST_SERVER=y
CONFIG_BT_CAP_ACCEPTOR=y
CONFIG_BT_CAP_ACCEPTOR_SET_MEMBER=y
CONFIG_BT_PAC_SNK=y
CONFIG_BT_PAC_SNK_NOTIFIABLE=y
CONFIG_BT_PAC_SRC=y
CONFIG_BT_PAC_SRC_NOTIFIABLE=y
CONFIG_BT_CSIP_SET_MEMBER=y
CONFIG_BT_DEVICE_APPEARANCE=2369

CONFIG_BT_ISO_MAX_CHAN=2
CONFIG_BT_ASCS=y
CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT=1
CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT=1
CONFIG_BT_VCP_VOL_REND=y
CONFIG_BT_MCC=y
CONFIG_BT_MCC_READ_MEDIA_STATE=y
CONFIG_BT_MCC_SET_MEDIA_CONTROL_POINT=y
CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n
#CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE=25

CONFIG_LC3_ENC_CHAN_MAX=1
CONFIG_LC3_DEC_CHAN_MAX=1
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=2048


CONFIG_BT=y
CONFIG_BT_OBSERVER=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_PER_ADV_SYNC=y

CONFIG_BT_PERIPHERAL=y
CONFIG_BT_AUDIO=y
CONFIG_BT_PAC_SNK=y
CONFIG_BT_SMP=y
CONFIG_BT_GATT_DYNAMIC_DB=y
CONFIG_BT_BAP_SCAN_DELEGATOR=y
CONFIG_BT_BAP_BROADCAST_SINK=y
CONFIG_BT_ISO_SYNC_RECEIVER=y

CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE=128
CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE=255

CONFIG_BT_ATT_PREPARE_COUNT=10


CONFIG_SETTINGS=y
CONFIG_SETTINGS_NVS=y
CONFIG_NVS=y
CONFIG_BT_SETTINGS=y
CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE=y

But the compilation will report an error: What other configs do I need to add?

C:/ncs/nrf5340_audio/nrf5340_audio/unicast_server/pa_sync.c:123: undefined reference to `bt_bap_base_get_pres_delay'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ncs/nrf5340_audio/nrf5340_audio/unicast_server/pa_sync.c:124: undefined reference to `bt_bap_base_get_subgroup_count'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ncs/nrf5340_audio/nrf5340_audio/unicast_server/pa_sync.c:131: undefined reference to `bt_bap_base_get_bis_indexes'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ncs/nrf5340_audio/nrf5340_audio/unicast_server/pa_sync.c:136: undefined reference to `bt_bap_base_foreach_subgroup'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(pa_sync.c.obj): in function `reset_sync_state':    
C:/ncs/nrf5340_audio/nrf5340_audio/unicast_server/pa_sync.c:37: undefined reference to `bt_bap_broadcast_sink_delete'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(base_parse.c.obj): in function `foreach_subgroup_cb':
C:/ncs/nrf5340_audio/nrf5340_audio/unicast_server/base_parse.c:32: undefined reference to `bt_bap_base_get_subgroup_codec_data'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ncs/nrf5340_audio/nrf5340_audio/unicast_server/base_parse.c:42: undefined reference to `bt_bap_base_get_subgroup_codec_meta'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ncs/nrf5340_audio/nrf5340_audio/unicast_server/base_parse.c:54: undefined reference to `bt_bap_base_subgroup_get_bis_indexes'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ncs/nrf5340_audio/nrf5340_audio/unicast_server/base_parse.c:67: undefined reference to `bt_bap_base_subgroup_codec_to_codec_cfg'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ncs/nrf5340_audio/nrf5340_audio/unicast_server/base_parse.c:117: undefined reference to `bt_bap_base_subgroup_foreach_bis'
c:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(base_parse.c.obj): in function `ad_try_get_base':  
C:/ncs/nrf5340_audio/nrf5340_audio/unicast_server/base_parse.c:125: undefined reference to `bt_bap_base_get_base_from_

Parents Reply Children
  • Hi, there is a new error:

    PS C:\ncs\nrf5340_audio\nrf5340_audio\tools\buildprog> python .\buildprog.py -c both -b debug -d headset -t unicast
    No programmer/debugger connected to PC
    No snrs connected
    +------------+----------+---------+--------------+---------------------+---------------------+
    |    snr     | snr conn |  device | only reboot  | core app programmed | core net programmed |
    +------------+----------+---------+--------------+---------------------+---------------------+
    | 1050193411 |  False   | headset | Not selected |       Selected      |       Selected      |
    |    1000    |  False   | gateway | Not selected |     Not selected    |     Not selected    |
    |    1000    |  False   | headset | Not selected |       Selected      |       Selected      |
    +------------+----------+---------+--------------+---------------------+---------------------+
    Invoking build step
    Run: west build C:\ncs\nrf5340_audio\nrf5340_audio -b nrf5340_audio_dk/nrf5340/cpuapp --sysbuild --domain nrf5340_audio -d C:\ncs\nrf5340_audio\nrf5340_audio\tools\build\unicast\headset\app\debug
    -- west build: building domain(s): nrf5340_audio
    [0/1] Re-running CMake...
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/ncs/nrf5340_audio/nrf5340_audio
    -- CMake version: 3.21.0
    -- Cache files will be written to: C:/ncs/v3.0.2/zephyr/.cache
    -- Zephyr version: 4.0.99 (C:/ncs/v3.0.2/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340_audio_dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v3.0.2/zephyr/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: C:/ncs/nrf5340_audio/nrf5340_audio/tools/build/unicast/headset/app/debug/nrf5340_audio/zephyr/zephyr.dts
    -- Generated pickled edt: C:/ncs/nrf5340_audio/nrf5340_audio/tools/build/unicast/headset/app/debug/nrf5340_audio/zephyr/edt.pickle
    -- Generated zephyr.dts: C:/ncs/nrf5340_audio/nrf5340_audio/tools/build/unicast/headset/app/debug/nrf5340_audio/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/ncs/nrf5340_audio/nrf5340_audio/tools/build/unicast/headset/app/debug/nrf5340_audio/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: C:/ncs/nrf5340_audio/nrf5340_audio/tools/build/unicast/headset/app/debug/nrf5340_audio/zephyr/dts.cmake
    Parsing C:/ncs/nrf5340_audio/nrf5340_audio/Kconfig
    Loaded configuration 'C:/ncs/v3.0.2/zephyr/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpuapp_defconfig'
    Merged configuration 'C:/ncs/nrf5340_audio/nrf5340_audio/prj.conf'
    Merged configuration 'C:/ncs/nrf5340_audio/nrf5340_audio/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf'
    Merged configuration 'C:\ncs\nrf5340_audio\nrf5340_audio\unicast_server\overlay-unicast_server.conf'
    Merged configuration 'C:/ncs/nrf5340_audio/nrf5340_audio/tools/build/unicast/headset/app/debug/nrf5340_audio/zephyr/.config.sysbuild'
    
    error: BT_BAP_BASE (defined at C:/ncs/v3.0.2/zephyr/subsys/bluetooth/host\../audio\Kconfig.bap:283,
    subsys/bluetooth\host\../audio\Kconfig.bap:283) is assigned in a configuration file, but is not
    directly user-configurable (has no prompt). It gets its value indirectly from other symbols. See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_BT_BAP_BASE and/or look up BT_BAP_BASE in
    the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
    Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.
    
    CMake Error at C:/ncs/v3.0.2/zephyr/cmake/modules/kconfig.cmake:396 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      C:/ncs/v3.0.2/nrf/cmake/modules/kconfig.cmake:36 (include)
      C:/ncs/v3.0.2/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
      C:/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
      CMakeLists.txt:13 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/ncs/nrf5340_audio/nrf5340_audio/tools/build/unicast/headset/app/debug/nrf5340_audio/CMakeFiles/CMakeOutput.log".
    See also "C:/ncs/nrf5340_audio/nrf5340_audio/tools/build/unicast/headset/app/debug/nrf5340_audio/CMakeFiles/CMakeError.log".
    ←[31mFAILED: ←[0mbuild.ninja 
    C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.exe --regenerate-during-build -SC:\ncs\nrf5340_audio\nrf5340_audio -BC:\ncs\nrf5340_audio\nrf5340_audio\tools\build\unicast\headset\app\debug\nrf5340_audio
    ninja: error: rebuilding 'build.ninja': subcommand failed
    ←[91mFATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.EXE' --build C:/ncs/nrf5340_audio/nrf5340_audio/tools/build/unicast/headset/app/debug/nrf5340_audio
    ←[0mTraceback (most recent call last):
      File "C:\ncs\nrf5340_audio\nrf5340_audio\tools\buildprog\buildprog.py", line 418, in <module>
        __main()
      File "C:\ncs\nrf5340_audio\nrf5340_audio\tools\buildprog\buildprog.py", line 400, in __main
        __build_module(build_cfg, options)
      File "C:\ncs\nrf5340_audio\nrf5340_audio\tools\buildprog\buildprog.py", line 172, in __build_module
        raise Exception("cmake error: " + str(ret_val))
    Exception: cmake error: 1

  • Remove it and add "#include <zephyr/bluetooth/audio/bap.h>"

  • Hi, you can see my previous comment, I have already added "#include <zephyr/bluetooth/audio/bap.h>", but later I found that adding CONFIG_BT_ISO_SYNC_RECEIVER=y will not cause these undefined errors.

Related