This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Coded phy PC application Connection request Failed, reason 19

Hi,

I am developing a Linux PC application interfacing nrf52840 dongle using pc-ble-driver v4.1. I am trying to use the Long Range feature with Coded PHY. The setup in like:

  • An nrf52840 dongle programmed with ble_app_rscs example from SDK as peripheral
  • An nrf52840 dongle programmed with connectivity_4.1.1_usb_with_s140_6.1.1 plugged in to a Linux computer as central
  • A Linux computer running an application interfacing the central BLE 

When the Linux application sets scan_phys member in ble_gap_scan_params_t to BLE_GAP_PHY_1MBPS everything just works. I can scan for advertisements, initiating a connection request and connection established. However, if I change the scan_phys to BLE_GAP_PHY_CODED I can still scan for advertisements, but connection request fails with the following:

Serial port used: /dev/ttyACM0
Baud rate used: 115200
Info: Successfully opened /dev/ttyACM0. Baud rate: 115200. Flow control: none. Parity: none.
Status: 6, message: Target Reset performed
Status: 7, message: Connection active
Scan started...
Received advertisement report with device address: 0xEB47********
Connection Request Failed, reason 19

Looking at return value of sd_ble_gap_connect, error_code 19 will refer to NRF_ERROR_RESOURCES which according to docs, can be because of either of the following:

 - Not enough BLE role slots available.
   Stop one or more currently active roles (Central, Peripheral or Observer) and try again.
 - The event_length parameter associated with conn_cfg_tag is too small to be able to
   establish a connection on the selected @ref ble_gap_scan_params_t::scan_phys.
   Use @ref sd_ble_cfg_set to increase the event length.

1. Can you please elaborate what the problem is and how I can fix it?
2. Should I set specific parameter with sd_ble_cfg_set?
3. Is there a sequence diagram describing long range advertisement and connection establishment?

Thanks!

Related