TX power reduction with bap_broadcast_source

Hello, 

I'm trying to reduce the range of transmission of the nRF5340 SoC for an Auracast Broadcast. I would like it to be detectable only from a distance of 1 or 2 meters.

I've tried to force the TX_PWR to -20 dB in the configuration menu (west build -t menuconfig), but every time I try to build the project, there are configuring errors :

CMake Error at C:/ncs/v2.8.0/zephyr/cmake/modules/kconfig.cmake:396 (message):
command failed with return code: 1
Call Stack (most recent call first):
C:/ncs/v2.8.0/nrf/cmake/modules/kconfig.cmake:29 (include)
C:/ncs/v2.8.0/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
-- Configuring incomplete, errors occurred!
C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
CMakeLists.txt:4 (find_package)

Has anyone encountered this issue and resolved it?

  • Hello Dejan,

    I understand your reply and I indeed wasn't saving the new configuration for the hci_ipc image but for the bap_broadcast_source one. Now that this is done, I still have an error while building with the modifications (not pristine build) : 

    Best regards,

    Axelle

  • Hi Axelle,

    Are you able to successfully build bap_broadcast_source sample without modifications?

    Can you provide full log (instead of partial screenshot) in a separate file and upload it here using Insert -> Image/video/file -> Upload?

    Best regards,
    Dejan

  • Hello Dejans,

    I can build it without modifications and even when I change the name of the broadcast or add a password to it. The only modiication I've tried that hasn't work is to force the TX_PWR to -20 dB.

    Can you provide full log (instead of partial screenshot) in a separate file and upload it here using Insert -> Image/video/file -> Upload?

    I would like to know which log do you want. The one when i can build the application or the one when I can't ?

    Best regards,

    Axelle

  • Hi Axelle,

    Try to start from unmodified sample and then only change Tx power using menuconfig and build.  Does the sample build successfully for you?
    In our testing, there were no build errors if Tx power was the only change. Did you make any other changes to the sample?

    Axelle said:
    I would like to know which log do you want. The one when i can build the application or the one when I can't ?

    I am interested in failing log. 
    Is the error reproducible on your side? If the error you get is reproducible, please provide all steps that are necessary to reproduce the issue, and I can try to replicate it.

    Best regards,
    Dejan

  • Hi Dejans,

    Here are the steps I've done so far : 

    1. select the bap_broadcast_source sample from NCS v2.8.0
    2. build this sample for nRF5340_audio_dk
    3. used west build -t menuconfig
    4. change the value of TX power to -12
    5. saved using Maj+S and modify the path to save it in the hci_ipc image 
    6. build (not pristine) the application

     *  Executing task: nRF Connect: Build: bap_broadcast_source_test/build (active) 
    
    Building bap_broadcast_source_test
    C:\WINDOWS\system32\cmd.exe /d /s /c "west build --build-dir d:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build d:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test"
    
    [0/1] Re-running CMake...
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/ncs/v2.8.0/zephyr/samples/bluetooth/hci_ipc
    -- CMake version: 3.21.0
    -- Cache files will be written to: C:/ncs/v2.8.0/zephyr/.cache
    -- Zephyr version: 3.7.99 (C:/ncs/v2.8.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340_audio_dk, qualifiers: nrf5340/cpunet
    -- Snippet(s): bt-ll-sw-split
    -- Found host-tools: zephyr 0.16.8 (C:/ncs/toolchains/2d382dcd92/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.8 (C:/ncs/toolchains/2d382dcd92/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v2.8.0/zephyr/boards/nordic/nrf5340_audio_dk/nrf5340_audio_dk_nrf5340_cpunet.dts
    -- Found devicetree overlay: C:/ncs/v2.8.0/zephyr/snippets/bt-ll-sw-split/bt-ll-sw-split.overlay
    -- Generated zephyr.dts: D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/hci_ipc/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/hci_ipc/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/hci_ipc/zephyr/dts.cmake
    
    warning: Experimental symbol BT_LL_SW_SPLIT is enabled.
    
    
    warning: Experimental symbol BT_CTLR_ADV_ISO is enabled.
    
    
    warning: Experimental symbol BT_CTLR_SET_HOST_FEATURE is enabled.
    
    
    warning: Experimental symbol USB_DEVICE_AUDIO is enabled.
    
    Parsing C:/ncs/v2.8.0/zephyr/Kconfig
    Loaded configuration 'D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/hci_ipc/zephyr/.config'
    Merged configuration 'D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/hci_ipc/zephyr/.config.sysbuild'
    Configuration saved to 'D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/hci_ipc/zephyr/.config'
    Kconfig header saved to 'D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/hci_ipc/zephyr/include/generated/zephyr/autoconf.h'
    CMake Warning at C:/ncs/v2.8.0/zephyr/subsys/usb/device/CMakeLists.txt:22 (message):
      CONFIG_USB_DEVICE_VID has default value 0x2FE3.
    
      This value is only for testing and MUST be configured for USB products.
    
    
    CMake Warning at C:/ncs/v2.8.0/zephyr/subsys/usb/device/CMakeLists.txt:28 (message):
      CONFIG_USB_DEVICE_PID has default value 0x100.
    
      This value is only for testing and MUST be configured for USB products.
    
    
    -- Build type:  MinSizeRel
    -- libmetal version: 1.6.0 (C:/ncs/v2.8.0/zephyr/samples/bluetooth/hci_ipc)
    -- Host:    Windows/AMD64
    -- Target:  Generic/arm
    -- Machine: arm
    -- open-amp version: 1.6.1 (C:/ncs/v2.8.0/modules/lib/open-amp/open-amp)
    -- Host:    Windows/AMD64
    -- Target:  Generic/arm
    -- Machine: arm
    -- C_FLAGS :  -Wall -Wextra
    CMake Warning at C:/ncs/v2.8.0/zephyr/CMakeLists.txt:952 (message):
      No SOURCES given to Zephyr library: drivers__usb__device
    
      Excluding target from build.
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/hci_ipc
    [99/267] Building C object zephyr/subsys/usb/device/class/audio/CMakeFiles/subsys__usb__device__class__audio.dir/audio.c.obj
    C:/ncs/v2.8.0/zephyr/subsys/usb/device/class/audio/audio.c:853:12: warning: 'usb_audio_device_init' defined but not used [-Wunused-function]
      853 | static int usb_audio_device_init(const struct device *dev)
          |            ^~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.8.0/zephyr/subsys/usb/device/class/audio/audio.c:837:12: warning: 'audio_class_handle_req' defined but not used [-Wunused-function]
      837 | static int audio_class_handle_req(struct usb_setup_packet *pSetup,
          |            ^~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.8.0/zephyr/subsys/usb/device/class/audio/audio.c:767:12: warning: 'audio_custom_handler' defined but not used [-Wunused-function]
      767 | static int audio_custom_handler(struct usb_setup_packet *pSetup, int32_t *len,
          |            ^~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.8.0/zephyr/subsys/usb/device/class/audio/audio.c:348:13: warning: 'audio_cb_usb_status' defined but not used [-Wunused-function]
      348 | static void audio_cb_usb_status(struct usb_cfg_data *cfg,
          |             ^~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.8.0/zephyr/subsys/usb/device/class/audio/audio.c:306:13: warning: 'audio_interface_config' defined but not used [-Wunused-function]
      306 | static void audio_interface_config(struct usb_desc_header *head,
          |             ^~~~~~~~~~~~~~~~~~~~~~
    [262/267] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/hci_ipc/zephyr/zephyr_pre0.map 
    cmd.exe /C "cd . && C:\ncs\toolchains\2d382dcd92\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -Os -DNDEBUG -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr\zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -fuse-ld=bfd  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/hci_ipc/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/cortex_m/cmse/libarch__arm__core__cortex_m__cmse.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/lib/net_buf/liblib__net_buf.a  zephyr/soc/soc/nrf5340/libsoc__nordic.a  zephyr/subsys/random/libsubsys__random.a  zephyr/subsys/usb/device/class/audio/libsubsys__usb__device__class__audio.a  zephyr/subsys/bluetooth/common/libsubsys__bluetooth__common.a  zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a  zephyr/subsys/bluetooth/audio/libsubsys__bluetooth__audio.a  zephyr/subsys/bluetooth/crypto/libsubsys__bluetooth__crypto.a  zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a  zephyr/subsys/bluetooth/controller/ll_sw/nordic/libsubsys__bluetooth__controller__ll_sw__nordic.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/entropy/libdrivers__entropy.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/hwinfo/libdrivers__hwinfo.a  zephyr/drivers/mbox/libdrivers__mbox.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/regulator/libdrivers__regulator.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  modules/libmetal/libmetal/lib/libmetal.a  modules/open-amp/open-amp/lib/libopen_amp.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L"c:/ncs/toolchains/2d382dcd92/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v8-m.main/nofp"  -LD:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/hci_ipc/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m33+nodsp  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -mtp=soft  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -DPICOLIBC_DOUBLE_PRINTF_SCANF  --specs=picolibc.specs  -lc  -lgcc && cmd.exe /C "cd /D D:\nRF5340_AudioDK\Exploration_linux\bap_broadcast_source_test\build\hci_ipc\zephyr && C:\ncs\toolchains\2d382dcd92\opt\bin\cmake.exe -E true""
    c:/ncs/toolchains/2d382dcd92/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(crypto.c.obj): in function `bt_rand':
    C:/ncs/v2.8.0/zephyr/subsys/bluetooth/controller/crypto/crypto.c:20: multiple definition of `bt_rand'; zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(crypto_tc.c.obj):C:/ncs/v2.8.0/zephyr/subsys/bluetooth/host/crypto_tc.c:80: first defined here
    c:/ncs/toolchains/2d382dcd92/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(crypto.c.obj): in function `bt_encrypt_le':
    C:/ncs/v2.8.0/zephyr/subsys/bluetooth/controller/crypto/crypto.c:25: multiple definition of `bt_encrypt_le'; zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(crypto_tc.c.obj):C:/ncs/v2.8.0/zephyr/subsys/bluetooth/host/crypto_tc.c:116: first defined here
    c:/ncs/toolchains/2d382dcd92/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(crypto.c.obj): in function `bt_encrypt_be':
    C:/ncs/v2.8.0/zephyr/subsys/bluetooth/controller/crypto/crypto.c:38: multiple definition of `bt_encrypt_be'; zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(crypto_tc.c.obj):C:/ncs/v2.8.0/zephyr/subsys/bluetooth/host/crypto_tc.c:148: first defined here
    c:/ncs/toolchains/2d382dcd92/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(main.c.obj): in function `hci_ipc_cmd_recv':
    C:/ncs/v2.8.0/zephyr/samples/bluetooth/hci_ipc/src/main.c:64: undefined reference to `bt_buf_get_tx'
    c:/ncs/toolchains/2d382dcd92/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(main.c.obj): in function `hci_ipc_acl_recv':
    C:/ncs/v2.8.0/zephyr/samples/bluetooth/hci_ipc/src/main.c:101: undefined reference to `bt_buf_get_tx'
    c:/ncs/toolchains/2d382dcd92/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(main.c.obj): in function `hci_ipc_iso_recv':
    C:/ncs/v2.8.0/zephyr/samples/bluetooth/hci_ipc/src/main.c:138: undefined reference to `bt_buf_get_tx'
    c:/ncs/toolchains/2d382dcd92/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(main.c.obj): in function `main':
    C:/ncs/v2.8.0/zephyr/samples/bluetooth/hci_ipc/src/main.c:389: undefined reference to `bt_enable_raw'
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/hci_ipc-prefix/src/hci_ipc-stamp/hci_ipc-build D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build/_sysbuild/hci_ipc-prefix/src/hci_ipc-stamp/hci_ipc-build 
    cmd.exe /C "cd /D D:\nRF5340_AudioDK\Exploration_linux\bap_broadcast_source_test\build\hci_ipc && C:\ncs\toolchains\2d382dcd92\opt\bin\cmake.exe --build ."
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\2d382dcd92\opt\bin\cmake.EXE' --build D:/nRF5340_AudioDK/Exploration_linux/bap_broadcast_source_test/build
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 
    

    Best regards,

    Axelle

Related