nRF5340-DK - BLE multiple connection

Hello,

I'm trying to make the nrf5340-DK capable of connecting to BLE from multiple devices.

The program is based on: Bluetooth: Bluetooth: Peripheral UART.

I found the following discussions on this:

BLE multiple connections support - Nordic Q&A - Nordic DevZone - Nordic DevZone

Mutli role in NRF connect, Advertising while connected - Nordic Q&A - Nordic DevZone - Nordic DevZone

However the order only let me connect to one device and then it prints an advertising error:

[00:00:42.735,412] <wrn> bt_hci_core: opcode 0x200a status 0x0d
[00:00:42.735,443] <err> bt_adv: Failed to start advertiser
[00:00:42.735,473] <err> uart_debug: Advertising failed: -12


and thus nrf5340 stops being connectable for other devices.

in /proj.conf I have:

# UART async
CONFIG_UART_ASYNC_API=y

# Console/logging
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_LOG=y
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_BACKEND_RTT=n

# BLE
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="UART_Debug"
CONFIG_BT_MAX_CONN=4
CONFIG_BT_MAX_PAIRED=4

# NUS service
CONFIG_BT_NUS=y

# BLE settings
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y

# DK library pro LEDs
CONFIG_DK_LIBRARY=y

# Memory 
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Assert for debug
CONFIG_ASSERT=y

in src/sysbuild/ipc_radio/prj.conf I have:

CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_LOG=n

and in src/sysbuild/ipc_radio/prj_bt_rpc.conf:

CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_LOG=n

CONFIG_BT_PERIPHERAL=y
CONFIG_BT_CENTRAL=n
CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=4
CONFIG_BT_MAX_CONN=4
CONFIG_BT_MAX_PAIRED=4
CONFIG_BT_DEVICE_NAME="Nordic_UART_Service"

Can you advise me how to ensure multiple connections (from multiple devices) to nRF5340-DK possible at the same time, please?

Thank you

Parents Reply
  • So finally there was necessary to set: 

    CONFIG_BT_CENTRAL=n
    in the ipc_radio.conf, then it can be compiled. The config seems to be right in the network colee comiled file .config:

    But the next device cannot connect to the 5340-DK and read/write data (advertising is stopped after connection of first device). Couldn't be problem in the program - I'm using unchanged Peripheral_UART sample. Can you please advise me? 

    Thank you

Children
  • iotdeveloper said:

    Couldn't be problem in the program - I'm using unchanged Peripheral_UART sample. Can you please advise me? 

    The original sample is not made to support multiple concurrent connections and therefore will not restart the connectable advertiser until the active connection has been terminated, but seems like you are aware of this already based on the changes you made in your UART_BT_multi_test.c file.

Related