Debug: cannot set breakpoint in VS Code

Hi guys, my setup:

- nRf Connect 2.6.0

- VS Code 1.88.1

- Apple Macbook M3 Max (ARM64 CPU)

- nRF52840-DK

I created a new project based on the zephyr button sample. It builds and it runs as expected.

I cannot set a breakpoint in the button_pressed() callback. I've rebuilt, and I added a useless incrementing integer to maybe prod the debugger into accepting a breakpoint. This does not work. The code:

I build, then debug which also flashes the device. The breakpoint I just added disappears:

I attempt to set it again, and a duplicate breakpoint gets added at line 44, the beginning of main().

The first code line is line 47, "if (!gpio_is_ready_dt(&button))". I cannot set a breakpoint here. When I try, a breakpoint gets set to line 48, "printk([...])".

I also cannot set breakpoints at the following: "ret = gpio_pin_interrupt_configure_dt(&buttonGPIO_INT_EDGE_TO_ACTIVE);", "gpio_init_callback(&button_cb_data, button_pressed, BIT(button.pin));".

What's going on here?

Related