Debugging Bluetooth: bt_hci_core: opcode 0x2039 status 0x0d

I'm using SDK version 2.9.0 with an nRF52840 in a combined peripheral / central application.

The nRF52840 device starts advertising, but then after connecting (as a peripheral) it throws the warning: <wrn> bt_hci_core: opcode: 0x2039 status 0x0d

It appears the opcode is for advertising and the status indicates limited resources.

CONFIG_BT_MAX_CONN is set to 8

Is there a way to determine what "Resources" are being reported as limited?   Or more information on how to clear this warning?

Thanks!

Parents
  • Hi

    I need to know a bit more about your project to help out here I think, as it could be a lot of different reasons that you get this limited resources warning. Do you use pairing/bonding in your application? If so, you will also need to set CONFIG_BT_MAX_PAIRED to the amount of paired devices you would like to have. 

    I assume you've also set the device to be able to both be a peripheral and central with CONFIG_BT_PERIPHERAL=y and CONFIG_BT_CENTRAL=y?

    What have you set the various buffers to in your config file? Here are some suggested values.

    CONFIG_HEAP_MEM_POOL_SIZE=8192
    CONFIG_MAIN_STACK_SIZE=2048
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

    You could also try enabling debugging to see what function exactly it is that returns this limited resources warning. Also, this is just a warning, and not an error, so does the application stop working after connecting to one device or what?

    Best regards,

    Simon

  • Thanks...   I found that when I moved from SDK 2.7.0 to SDK 2.9.0 some additional CONFIG_BT settings were needed...

  • Can you share what those additional config settings were? I'm doing a similar move to 2.9.1 and having the same issue of status 0x0d. 

  • I don't remember all of the changes, so perhaps the easiest way would be for me to share all the config statements I use for Bluetooth.   

    # Bluetooth configuration
    # General Bluetooth
    CONFIG_BT=y
    CONFIG_BT_SMP=y
    CONFIG_BT_PERIPHERAL=y
    #CONFIG_BT_LL_SW_SPLIT=n
    
    #CONFIG_BT_HCI=y
    
    # BLE Sizing
    CONFIG_BT_RX_STACK_SIZE=4096
    
    CONFIG_BT_MAX_CONN=2
    CONFIG_BT_MAX_PAIRED=2
    
    CONFIG_BT_DIS=y
    CONFIG_BT_DIS_MANUF="Your Company Name"
    
    CONFIG_BT_DEVICE_NAME="Your Device Name"
    CONFIG_BT_DEVICE_NAME_DYNAMIC=y
    CONFIG_BT_DEVICE_NAME_MAX=32
    CONFIG_BT_DEVICE_APPEARANCE=833
    CONFIG_BT_DIS_PNP=n
    CONFIG_BT_BAS=n
    CONFIG_BT_HRS=n
    
    CONFIG_BT_CTLR_TX_PWR_MINUS_8=y
    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_CTLR_PHY_CODED=y
    CONFIG_BT_CTLR_ADV_EXT=y
    #CONFIG_BT_PER_ADV=y
    
    CONFIG_BT_USER_DATA_LEN_UPDATE=y
    CONFIG_BT_USER_PHY_UPDATE=y
    CONFIG_BT_ATT_PREPARE_COUNT=2
    CONFIG_BT_CONN_TX_MAX=10
    CONFIG_BT_L2CAP_TX_BUF_COUNT=8
    CONFIG_BT_L2CAP_TX_MTU=247
    CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
    CONFIG_BT_CTLR_PHY_2M=y
    CONFIG_BT_CTLR_RX_BUFFERS=2
    CONFIG_BT_BUF_ACL_RX_SIZE=250
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=250
    
    CONFIG_BT_GATT_CLIENT=y
    Obviously, you might need to change some of these to fit your application, but these work for me (and will compile!).    I believe one of the statements I had to add was "CONFIG_BT_CTLR_ADV_EXT=y"
    By the way, I'm using Zephyr, but using the Nordic Bluetooth stack (soft core).
Reply
  • I don't remember all of the changes, so perhaps the easiest way would be for me to share all the config statements I use for Bluetooth.   

    # Bluetooth configuration
    # General Bluetooth
    CONFIG_BT=y
    CONFIG_BT_SMP=y
    CONFIG_BT_PERIPHERAL=y
    #CONFIG_BT_LL_SW_SPLIT=n
    
    #CONFIG_BT_HCI=y
    
    # BLE Sizing
    CONFIG_BT_RX_STACK_SIZE=4096
    
    CONFIG_BT_MAX_CONN=2
    CONFIG_BT_MAX_PAIRED=2
    
    CONFIG_BT_DIS=y
    CONFIG_BT_DIS_MANUF="Your Company Name"
    
    CONFIG_BT_DEVICE_NAME="Your Device Name"
    CONFIG_BT_DEVICE_NAME_DYNAMIC=y
    CONFIG_BT_DEVICE_NAME_MAX=32
    CONFIG_BT_DEVICE_APPEARANCE=833
    CONFIG_BT_DIS_PNP=n
    CONFIG_BT_BAS=n
    CONFIG_BT_HRS=n
    
    CONFIG_BT_CTLR_TX_PWR_MINUS_8=y
    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_CTLR_PHY_CODED=y
    CONFIG_BT_CTLR_ADV_EXT=y
    #CONFIG_BT_PER_ADV=y
    
    CONFIG_BT_USER_DATA_LEN_UPDATE=y
    CONFIG_BT_USER_PHY_UPDATE=y
    CONFIG_BT_ATT_PREPARE_COUNT=2
    CONFIG_BT_CONN_TX_MAX=10
    CONFIG_BT_L2CAP_TX_BUF_COUNT=8
    CONFIG_BT_L2CAP_TX_MTU=247
    CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
    CONFIG_BT_CTLR_PHY_2M=y
    CONFIG_BT_CTLR_RX_BUFFERS=2
    CONFIG_BT_BUF_ACL_RX_SIZE=250
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=250
    
    CONFIG_BT_GATT_CLIENT=y
    Obviously, you might need to change some of these to fit your application, but these work for me (and will compile!).    I believe one of the statements I had to add was "CONFIG_BT_CTLR_ADV_EXT=y"
    By the way, I'm using Zephyr, but using the Nordic Bluetooth stack (soft core).
Children
No Data
Related