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

L2CAP connection refused with BLE_L2CAP_CH_STATUS_CODE_NO_RESOURCES

I'm trying to get iOS to open an L2CAP Connection Oriented Channel on the nRF52840.

I'm stuck at the nRF always rejecting the connection with result 0x0004 (Connection refused – no resources available).
On the firmware, an event BLE_L2CAP_EVT_CH_SETUP_REFUSED is raised with Source=Local, Status=BLE_L2CAP_CH_STATUS_CODE_NO_RESOURCES.

It sounds like I need to configure the stack to allocate resources for the L2CAP connection.
I've tried to set:

#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 3
#define NRF_SDH_BLE_TOTAL_LINK_COUNT 3

thinking that this could be related to the number of L2CAP channels but it made no difference.
What does the SD need to accept L2CAP connection?

Also, if I break the program in the debugger and the resume it, it tends to crash with a SD assert for PC 0x00012cfa.
I'm not sure if it's relevant, but it looks odd.

Parents Reply Children
  • Hi Mttrinh,

    I'm using S140 nRF52 6.0.0.

    I've started the project from the ble_app_template sample project, which calls nrf_sdh_ble_default_cfg_set().
    I thought that function would fully configure the stack as specified in sdk_config.h but now that you mentioned it I've checked and noticed it calls sd_ble_cfg_set() to configure various things but not L2CAP.
    I've added the L2CAP configuration, with ch_count=1 as the default is 0, and now it works.

    Thank you for pointing me in the right direction Slight smile

  • Hi Marco,

    Have you done any throughput testing between iOS and the NRF52 using L2CAP CoC? Just curious. I was able to get around 600kbps with the 2M phy between iPhone X and NRF52 using notifications. Curious how much of an increase using L2CAP CoC might add 

  • Hello Joe,

    The project I was working on has been put on hold. I can't find any notes about my tests but I'm pretty sure I couldn't get to the 40 kB/s (about 400 kbps?) that were the requirement. My tests were done with an iPhone 6s and an iPad 5th gen. I can't tell what the maximum performance would be as I didn't fully investigate all the options to tune the configuration.

    FYI, a couple of related points that you might want to consider:

    • At the time, Android support was a concern as the API for CoC seemed to only be available on latest OS versions.
    • Performance varies significantly depending on the iOS device

    Sorry if this is not particularly helpful.

Related