"Failed to launch GDB: .pioinit:13: Error in sourced command file: Remote communication error. Target disconnected.: Success. (from interpreter-exec console “source .pioinit”)".

If I set Boot 0 to 1 and click on Start Debugging, then it appears that the code compiles, uploads and enters debugging mode but the variables I'm watching don't seem to change. To check, I added a counter which is meant to increment every time the main loop finishes but value seems to start at 64 and stay there.
Also, when debugging starts, VScode opens this file: C:\Users\piter\.platformio\packages\framework-arduinoststm32\variants\STM32F1xx\F103C8T_F103CB(T-U)\startup_M200_f103xb.S

I posted the entirety of my program here: https://pastebin.com/U0UXywP2
I'd appreciate any insight into what's going wrong for me. Thanks in advance.
Version: 1.76.2 (user setup)
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:55:54.936Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.19045
Sandboxed: No