Cannot get past bt_enable with debugger connected.

Hi, I have this problem and I couldn't find any working solutions.

I am developing my own hardware and there weren't any problems until I started to use debugger. 

My program (and also periphetial example) doesn't go past bt_enable(NULL); function when I'm running it with gdb debugger. 
I'm using Jlink GDB server and VS Code with configuration:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug with J-Link (External Server)",
            "cwd": "${workspaceRoot}",
            "executable": "${workspaceRoot}/build/peripheral/zephyr/zephyr.elf",
            "request": "launch",
            "type": "cortex-debug",
            "servertype": "external", // Use "external" to connect to an already running server
            "gdbTarget": "localhost:2331", // Connect to the server running on port 2331
            "device": "nrf52", // Replace with your target device (e.g., "stm32f4x", "nrf52840", etc.)
            "interface": "swd", // Use "swd" or "jtag" depending on your setup
            "gdbPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gdb.exe", // Path to your GDB executable
            "runToMain": true, // Optional: Run to main() automatically
            "showDevDebugOutput": "raw" // Optional: Show verbose GDB transactions for debugging
        }
    ]
}
When program is ran without dbg (just uploaded with JFlash and then using JFlash's Start application [F9] ) it is working great. However when I connect to gdb server and run it in debug mode (both builded with -Og) it stops on assert in function  bt_hci_cmd_send_sync on assert: 

BT_ASSERT_MSG(err == 0,
              "Controller unresponsive, command opcode 0x%04x timeout with err %d",
              opcode, err);

where I can see variable values err = -11 and opcode = 3075
Do you have any idea, what the problem may be?
Thank you!
Related