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
}
]
}
where I can see variable values err = -11 and opcode = 3075.

