Bluetooth master-slave start scan failed

I have written a master-slave program based on NCS 2.2.0 and use nRF52840 board.

Firstly, I turned on two broadcast frames and set the scan timeout to 0. This successfully enabled scanning. Here is my configuration.

CONFIG_BT=y
CONFIG_BT_CENTRAL=y
CONFIG_LOG=y
CONFIG_LOG_PRINTK=y
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=5122

CONFIG_BT_EXT_ADV=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_LL_SW_SPLIT=y

CONFIG_BT_EXT_ADV_MAX_ADV_SET=2
CONFIG_BT_MAX_CONN=2

But when I set the scan timeout to 2s, the scan fails to start. 

At this point if I set CONFIG_BT_EXT_ADV_MAX_ADV_SET to 3, I can successfully start the scan.

What I can't understand is what scanning has to do with CONFIG_BT_EXT_ADV_MAX_ADV_SET? Or there is some other reason why the scan failed to start?

Attached is my test sample

3124.central.zip

Parents
  • AHaug said:
    Scan timeout = 2
    CONFIG_BT_EXT_ADV_MAX_ADV_SET=2
    CONFIG_BT_MAX_CONN=3

    I have tested it in two situations and it does not work.

    1. Use Zephyr Controller: Scanning failed to start

    2. Use Nordic Controller: Failed to start advertiser

    AHaug said:
    It looks like that there could be an implied dependency that increases BT_MAX_CONN to 3 if BT_EXT_ADV_MAX_ADV_SET is set to 3 which might be why the scanning starts with the last configuration.

    When CONFIG_BT_EXT_ADV_MAX_ADV_SET=3, after compilation, CONFIG_BT_MAX_CONN is not increased to 3

    AHaug said:
    Having both Central and peripheral support = 2 connections. If you add scanning this will require BT_MAX_CONN = 3 to run.

    Scan timeout = 0
    CONFIG_BT_EXT_ADV_MAX_ADV_SET=2
    CONFIG_BT_MAX_CONN=2

    What I can't understand is that the above configuration works fine when the scan timeout is 0. According to you, doesn't it need to set CONFIG_BT_EXT_ADV_MAX_ADV_SET or CONFIG_BT_MAX_CONN to 3?

  • Hello,

    Andreas is out of office, so I will look into this ticket.

    Is this something that I would be able to reproduce on the nRF52840 DK? 

    Harvey Zheng said:
    2. Use Nordic Controller: Failed to start advertiser

    What value does the advertising start function return? 

    Best regards,

    Edvin

Reply Children
No Data
Related