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?

  • Additional information.

    I have two nRF5340 Audio DK boards, two MDBT53-DB boards made by RAYTAC, and two customer boards.

    I am developing software that uses the source code of nRF5340 Audio in VSCODE.

    With the same source code, the bt_mgmt_init(); function does not return an error when using the MDBT53-DB board, but an error code is returned when using the customer board.

    The customer board has a RAYTAC MDBT53-1M mounted on it.

    The difference is that the customer board does not have coils mounted on the DCCD, DCCH, or DCC terminals, so it cannot operate in DCDC mode.

    However, even when the MDBT53-1M is set to LDO mode, the mgmt_init(); function does not return an error.

    What could this be?

  • 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

  • I was wrong about "sometimes".

    In the same source code, the bt_mgmt_init(); function does not return an error when using the MDBT53-DB board, but returns an error code when using a customer board.

    The customer board has a RAYTAC MDBT53-1M.

    The difference is that the customer board does not have coils installed on the DCCD, DCCH, or DCC terminals, so it cannot operate in DCDC mode.

  • Hi,

    It seems that you opened a new case related to the same bt_mgmt_init() issue.
    https://devzone.nordicsemi.com/f/nordic-q-a/111750/nrf5340-dcdc-mode
    As a general note, opening new cases related to the original issue usually does not lead to a faster resolution. I suggest that you stay within the same case as long as your questions stay inside initial problem description. 
    Would you like to continue here or in your newly opened case?

    Best regards,
    Dejan

Related