How to keep Bluetooth connection active while debugging / stepping through Bluetooth-handling code?

I am using Zephyr 3.7.0 with the Nordic-provided low level link layer (LLL) code on an nRF52840-DK. I'd like to set a breakpoint on rp_comm_rx_decode() (https://github.com/zephyrproject-rtos/zephyr/blob/v3.7.0/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c#L950) and then just step through the code and watch how it parses packets. But when I do that with VS Code, the breakpoint fires, but I can't step through the code. If I do it with "west debug" (GDB-based), the breakpoint also fires, and I can step through the code at least, but the BLE connection is dead, so it doesn't do me any good.

Is there a way to debug this low level code while keeping the BLE connection running in the background? If not, how do the developers work on the code?

Parents Reply
  • This is not by any means specific to Zephyr or Nordic developers. You need to be creative in the embedded world since you are often closely connected to a reality which is not possible to control!

    Again, if you were simulating the whole system you can pause the entire simulation. In your case you have one device communicating with another device. You pause one of the devices using a breakpoint but the other device is still running and will very soon consider the connection as terminated.

Children
No Data
Related