Multilink example with nRF Connect

Hello i am new to Nordic. I found intresting examples like central_uart and peripherial_uart in nRF Connect SDK 1.7.0. These examples work well, but i need multilink central. I dont know how to change central_uart to be multilink. Example from SDK  samples/bluetooth/central_multilink doesnot compile at all. Can you give me any advices how to do that?    

P.S. I create a new app from sample for VS code (central_multilink) successfully. Then i trшув to add a build config for nrf52840dk and a lot of errors occurred. This can be seen in terminal:

> Executing task: nRF Connect: Generate config nrf52840dk_nrf52840 for c:\Nordic\Apps_WS_170_tst1\mmm <

Building mmm
west build --build-dir c:\Nordic\Apps_WS_170_tst1\mmm\build c:\Nordic\Apps_WS_170_tst1\mmm --pristine --board nrf52840dk_nrf52840 -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_OPENOCD_SUPPORT=y

-- west build: generating a build system
Including boilerplate (Zephyr base): C:/Nordic/v1.7.0/zephyr/cmake/app/boilerplate.cmake
-- Application: C:/Nordic/Apps_WS_170_tst1/mmm
-- Zephyr version: 2.6.99 (C:/Nordic/v1.7.0/zephyr), build: v2.6.99-ncs1
-- Found Python3: C:/Nordic/v1.7.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter
-- Found west (found suitable version "0.11.1", minimum required is "0.7.1")
-- Board: nrf52840dk_nrf52840
-- Cache files will be written to: C:/Nordic/v1.7.0/zephyr/.cache
-- Found dtc: C:/Nordic/v1.7.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (c:/Nordic/v1.7.0/toolchain/opt)
-- Found BOARD.dts: C:/Nordic/v1.7.0/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
-- Generated zephyr.dts: C:/Nordic/Apps_WS_170_tst1/mmm/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/Nordic/Apps_WS_170_tst1/mmm/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/Nordic/Apps_WS_170_tst1/mmm/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: C:/Nordic/Apps_WS_170_tst1/mmm/build/zephyr/dts.cmake

warning: BT_MAX_CONN (defined at C:\Nordic\v1.7.0\nrf\subsys\bluetooth\Kconfig:14,
c:\Nordic\Apps_WS_170_tst1\mmm\build\subsys\bluetooth\Kconfig:180) was assigned the value '62' but got the value '1'. See
docs.zephyrproject.org/.../CONFIG_BT_MAX_CONN.html and/or look up
BT_MAX_CONN 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.


warning: BT_PRIVACY (defined at c:\Nordic\Apps_WS_170_tst1\mmm\build\subsys\bluetooth\host\Kconfig:272) was assigned the value 'y' but
got the value 'n'. Check these unsatisfied dependencies: BT_SMP (=n). See
docs.zephyrproject.org/.../CONFIG_BT_PRIVACY.html and/or look up
BT_PRIVACY 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.


warning: user value 62 on the int symbol BT_MAX_CONN (defined at C:/Nordic/vParsing C:/Nordic/v1.7.0/zephyr/Kconfig
Loaded configuration 'C:/Nordic/v1.7.0/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
Merged configuration 'C:/Nordic/Apps_WS_170_tst1/mmm/prj.conf'
Merged configuration 'C:/Nordic/Apps_WS_170_tst1/mmm/build/zephyr/misc/generated/extra_kconfig_options.conf'
c:\Nordic\Apps_WS_170_tst1\mmm\build\1.7.0\nrf\subsys\bluetooth\Kconfig:14, c:\Nordic\Apps_WS_170_tst1\mmm\build\subsys\bluetooth\Kconfig:180) ignored due to being outside the active range ([1, 20]) -- falling back on defaults

error: Aborting due to Kconfig warnings

CMake Error at C:\Nordic\v1.7.0\zephyr\cmake\kconfig.cmake:268 (message):
command failed with return code: 1
Call Stack (most recent call first):
C:\Nordic\v1.7.0\zephyr\cmake\app\boilerplate.cmake:554 (include)
C:\Nordic\v1.7.0\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:24 (include)
C:\Nordic\v1.7.0\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:35 (include_boilerplate)
c:\Nordic\Apps_WS_170_tst1\mmm\build\CMakeLists.txt:4 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: 'c:\Nordic\v1.7.0\toolchain\opt\bin\cmake.EXE' '-DWEST_PYTHON=c:\Nordic\v1.7.0\toolchain\opt\bin\python.exe' '-Bc:\Nordic\Apps_WS_170_tst1\mmm\build' '-Sc:\Nordic\Apps_WS_170_tst1\mmm' -GNinja -DBOARD=nrf52840dk_nrf52840 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_OPENOCD_SUPPORT=y
The terminal process terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

I cant use guiconfig - it doesnot start

  • Try applying these changes to the central_multilink sample, then you should be able to build it with the nrf52840 DK without any warnings:

    diff --git a/samples/bluetooth/central_multilink/prj.conf b/samples/bluetooth/central_multilink/prj.conf
    index 68f8ca16f2..9f250af88f 100644
    --- a/samples/bluetooth/central_multilink/prj.conf
    +++ b/samples/bluetooth/central_multilink/prj.conf
    @@ -3,9 +3,8 @@ CONFIG_BT_CENTRAL=y
     CONFIG_BT_AUTO_PHY_UPDATE=n
     CONFIG_BT_PRIVACY=y
     
    -CONFIG_BT_MAX_CONN=62
    -
    +CONFIG_BT_MAX_CONN=20
     # CONFIG_BT_GATT_CLIENT=y
     
    -# CONFIG_BT_SMP=y
    +CONFIG_BT_SMP=y
     # CONFIG_BT_MAX_PAIRED=62
    

    Best regards,

    Simon

  • Adding to prj.conf  

    CONFIG_BT_MAX_CONN=20
    CONFIG_BT_SMP=y
    helped to compile the project. But compiled programm doesnot work. Starting debug:
    Please check TERMINAL tab (gdb-server) for output from C:\Program Files (x86)\SEGGER\JLink\JLinkGDBServerCL.exe
    Launching server: "C:\Program Files (x86)\SEGGER\JLink\JLinkGDBServerCL.exe" "-singlerun" "-nogui" "-if" "swd" "-port" "50000" "-swoport" "50001" "-telnetport" "50002" "-device" "nRF52840_xxAA" "-select" "usb=683711198" "-rtos" "C:\Program Files (x86)\SEGGER\JLink\GDBServer\RTOSPlugin_Zephyr.dll"
    Launching GDB: "c:\Nordic\v1.7.0\toolchain\opt\bin\arm-none-eabi-gdb.exe" "-q" "--interpreter=mi2"
    undefinedc:\Nordic\v1.7.0\toolchain\opt\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
    Reading symbols from c:\Nordic\Apps_WS_170_tst1\mmm\build\zephyr\zephyr.hex...
    (No debugging symbols found in c:\Nordic\Apps_WS_170_tst1\mmm\build\zephyr\zephyr.hex)
    0x00011c3a in ?? ()
    Program stopped, probably due to a reset and/or halt issued by debugger
    add symbol table from file "c:/Nordic/Apps_WS_170_tst1/mmm/build/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from c:/Nordic/Apps_WS_170_tst1/mmm/build/zephyr/zephyr.elf...
    2
    Resetting target
    Run to main timed out.
    [New Remote target]
    Thread
    2 received signal SIGTRAP, Trace/breakpoint trap.
    [Switching to Remote target]
    0x00003958 in ?? ()
  • Do you still see this? I'm not able to reproduce this. I added the changes I provided in my initial reply, then built and flashed the sample onto an nRF52840 DK. Then I programmed the BLE peripheral UART sample onto another chip and was able to connect to it.

    Here is the output from the central_multilink sample:

    *** Booting Zephyr OS build v2.6.99-ncs1  ***
    Bluetooth initialized
    Scanning successfully started
    Device found: DC:D8:E2:F6:BC:64 (random) (RSSI -22)
    Scanning successfully started
    Connected (1): DC:D8:E2:F6:BC:64 (random)
    Security changed: DC:D8:E2:F6:BC:64 (random) level 2
    LE conn param req: DC:D8:E2:F6:BC:64 (random) int (0x0018, 0x0028) lat 0 to 42
    LE conn param updated: DC:D8:E2:F6:BC:64 (random) int 0x0028 lat 0 to 42

    Best regards,

    Simon

Related