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?