The bt_mgmt_init function returns an error.

I am creating a program using the nRF5340 Audio sample source.
I am debugging using VSCODE instead of a script.

The bt_mgmt_init function returns error code -11.

Tracing it, I find that -11 is returned at err = bt_dev.drv->open(); in hci_core.c.
Tracing it further, I find that -11 is returned at ret = arch_swap(key); in kswap.h.

When debugging, sometimes the function no longer gives an error, and once it no longer gives an error, it works normally for a while, but when I do something else and try to run it again, the error comes back.

I think the bt_mgmt_init function is a Bluetooth initialization function, so I haven't made any changes to this part.

What could the cause be?

Parents
  • Hi,

    The bt_mgmt_init function returns error code -11.

    Can you show full log including the error?

    I think the bt_mgmt_init function is a Bluetooth initialization function

    Function bt_mgmt_init() initializes Bluetooth management module. Bluetooth subsystem is initialized using function bt_enable().

    When debugging, sometimes the function no longer gives an error, and once it no longer gives an error, it works normally for a while, but when I do something else and try to run it again, the error comes back.

    How often is "sometimes"? Do you do anything that could trigger different behavior? What do you refer to as "something else"? You could try to make smaller changes before debugging so that you could narrow down your potential issue.

    Best regards,
    Dejan

Reply
  • Hi,

    The bt_mgmt_init function returns error code -11.

    Can you show full log including the error?

    I think the bt_mgmt_init function is a Bluetooth initialization function

    Function bt_mgmt_init() initializes Bluetooth management module. Bluetooth subsystem is initialized using function bt_enable().

    When debugging, sometimes the function no longer gives an error, and once it no longer gives an error, it works normally for a while, but when I do something else and try to run it again, the error comes back.

    How often is "sometimes"? Do you do anything that could trigger different behavior? What do you refer to as "something else"? You could try to make smaller changes before debugging so that you could narrow down your potential issue.

    Best regards,
    Dejan

Children
Related