lookup meaning of bt_hci_core: opcode 0x2036 status 0x07

I have a project that I'm pulling in code from multiple_adv_sets using v2.7.0 and sysbuild.


Where can I find definition of bt_hci_core: opcode 0x200a status 0x09??? 

talks about the opcodes and status being in the spec?
https://www.bluetooth.com/specifications/specs/core-specification-5-3/

That spec is pretty large, it isn't clear to me where these are specified.  I did search for 2036.

Created adv: 0x200037d0
[00:00:00.084,136] <wrn> bt_hci_core: opcode 0x2036 status 0x07
Failed to create a connectable advertising set (err -5)

For additional background,
On startup from power off, the bt_hci_core output doesn't get all the way through, it is not always terminated at the same place.

[00:00:00.050,964] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.051,849] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:00.052,734] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
[00:00:00.054,779] <inf> b[00:00:08.118,682]

it then continues to run but its not clear from output what was and wasn't run after the bt_hci_core fails to initialize.

----

[00:00:00.055,908] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.056,793] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:00.057,678] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
[00:00:00.059,661] <inf> bt_hci_core: No ID address. App must call settings_load()
[00:00:00.062,835] <inf> bt_hci_core: Identity: X:X:X:X:X:X (random)
[00:00:00.063,720] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x21fb, manufacturer 0x0059
[00:00:00.064,849] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x21fb

If I wake sense after the initial power on, all the normal bt_hci_core output lines show with the -5 return code and the opcode and status code.

The code that is returning the -5 is:

err = advertising_set_create(&ext_adv[CONNECTABLE_ADV_IDX], connectable_adv_param,
                     connectable_data, ARRAY_SIZE(connectable_data));
    if (err) {
        printk("Failed to create a connectable advertising set (err %d)\n", err);
    }

I have defined to support existing code.

CONFIG_BT_BROADCASTER=y
CONFIG_BT_OBSERVER=y

and I'm now trying to use multiple_adv_sets to provide the beacon and connectable service.
I've pulled all the settings from the prj.conf in multiple_adv_sets.  I'm using sysbuild and I have the ipc_radio prj.conf defined.
The original existing broadcast/observer code is working even though this bt_hci_core has crashed/failed to initialize.

CONFIG_BT_PERIPHERAL was assigned the value y, but got the value n. Missing dependencies:
BT_RPC_STACK || (BT_HCI && BT)


I've tried adding BT_RPC_STACK and defining BT_HCI

CONFIG_BT_HCI was assigned the value y, but got the value n. Missing dependencies:
<choice BT_STACK_SELECTION>

I've got more notes; I've spent some time on this.  Any help is greatly appreciated.
  • Hello,

    The Bluetooth specification does specify the opcodes for all HCI commands (except vendor specific ones), the problem is that the value is split into fields named OCF and OGF, so the opcode value from the error log is not directly searchable. 

    I use to search for the opcode in the SDK tree instead:

    The status code can be found in the specification. See Vol. 1, Part F, Chapter 2.

    This error may, for instance, be raised if you try to add more advertisement sets than what has been allocated by the CONFIG_BT_CTLR_ADV_SET symbol in the 'ipc_radio' build. You can confirm the configurations set for the ipc_radio build by checking the generated .config file in build/ipc_radio/zephyr.

    and I'm now trying to use multiple_adv_sets to provide the beacon and connectable service.
    I've pulled all the settings from the prj.conf in multiple_adv_sets.  I'm using sysbuild and I have the ipc_radio prj.conf defined.
    The original existing broadcast/observer code is working even though this bt_hci_core has crashed/failed to initialize.

    CONFIG_BT_PERIPHERAL was assigned the value y, but got the value n. Missing dependencies:
    BT_RPC_STACK || (BT_HCI && BT)

    Did you also include the Kconfig.sysbuild file which enables the NRF_DEFAULT_IPC_RADIO symbol? And did you see the Kconfig warning while building the ipc_radio or the main application?

    Best regards,

    Vidar

  • Thank you for teaching me how to fish and making me a meal.

    I was able to get the the additional beacon and connectable service working by setting:

    CONFIG_BT_CTLR_ADV_SET=3 in prj.conf in sysbuild/ipc_radio

    .
    The first time the device turns on the output still terminates; wake sensing the device works as expected.
    Any ideas on how to go about debugging that?  I need to do some more testing...I keep seeing connected and disconnected events with (reason 19) happening; more to look into another fishing expedition for a code but I'm happy to see the services.  lmk if you've seen this before.

    >Did you also include the Kconfig.sysbuild file which enables the NRF_DEFAULT_IPC_RADIO symbol? And did you see the Kconfig warning while building the ipc_radio or the main application?

    Yes, I included the Kconfig.sysbuild and the symbol is enabled.  I did not see a warning and I don't see one in your screenshot.

  • tldr said:
    The first time the device turns on the output still terminates; wake sensing the device works as expected.
    Any ideas on how to go about debugging that?  I need to do some more testing...I keep seeing connected and disconnected events with (reason 19) happening; more to look into but I'm happy to see the services.  lmk if you've seen this before.

    Disconnect reason 19 corresponds to BT_HCI_ERR_REMOTE_USER_TERM_CONN and indicates that the connection was terminated by the peer device. Do you have any BLE security enabled in your application? Reason for asking is that the peer device may in some cases terminate the connection if it fails to secure the connection.

    Regarding the missing log messages, are you printing logs over RTT or UART. If using RTT, it may help to increase the 'CONFIG_SEGGER_RTT_BUFFER_SIZE_UP' size. The main() thread does not yield to the log processing thread during initilization which may cause the log buffer to become full. 

    CONFIG_BT_PERIPHERAL was assigned the value y, but got the value n. Missing dependencies:
    BT_RPC_STACK || (BT_HCI && BT)

    I was wondering where and when you saw the Kconfig warning above. I was not sure what could have caused this as both BT_HCI and BT should be enabled in the application.

    CONFIG_BT_RPC_STACK should only be enabled if you want to run the whole BT stack on the netcore: https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/nrf/device_guides/nrf53/features_nrf53.html 

  • Spot on Vidar.

    CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096

    Gives me the whole output!  That's a huge problem solved for me.  Why the difference in behavior from cold start and wake sense?  The 1024 default might be changed if normal output causes RTT users to get cut off.

    >Do you have any BLE security enabled in your application?

    I have exactly what is coming from multiple_adv_sets, which I believe does nothing with security.  I was wondering if its from nrf connect or some other device I have.  There is no other peer;  no other device is scanning and I'm not using nrfconnect when the connections and disconnections occur.

    > I was wondering where and when you saw the Kconfig warning above.
    The warning came from the tooltip hover provided in vscode that shows you the criteria for the flag.  I was reaching...

  • Disconnected: A4:F9:33:82:A2:FC (public) (reason 19)
    Connected A4:F9:33:82:A2:FC (public)
    Advertiser[2] 0x20001278 connected conn 0x20001408
    Disconnected: A4:F9:33:82:A2:FC (public) (reason 19)

    That mac address does not show in the nrf scanner; not sure what else to try.

Related