Open positron96 opened 5 months ago
Here is the init script https://github.com/platformio/platformio-core/blob/develop/platformio/debug/config/blackmagic.py
Could you help us to debug this issue?
Yes, I'll try to reproduce the failing setup...
Hi. Sorry it took so long to return to this issue. So, I am still experiencing this problem, and cannot reproduce it when manually running GDB commands. Here is my GDB session with commands generated by pio:
```
C:\Users\positron\.platformio\packages\toolchain-gccarmnoneeabi\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
GNU gdb (xPack GNU Arm Embedded GCC, 64-bit) 8.3.1.20191211-git
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
After running initialization commands, I did continue
, successfully arrived at main
breakpoint, which is already further than where PIO crashes. The same code (and the same elf) causes PIO to produce the error from issue description.
What kind of issue is this?
You can erase any parts of this template not applicable to your Issue.
Configuration
Operating system: Win 10 x64
PlatformIO Version (
platformio --version
): PlatformIO Core, version 6.1.15Description of problem
I've setup a project with STM32G030 MCU with blackmagicprobe used as debugger/uploader. The MCU has been programmed and debugged fine for a month, but at some point I noticed that debugging fails right at the start.
The error in VSCode Debug console is
Uploading firmware via BMP from PlatformIO still works. Uploading and debugging with stlink from PlatformIO also works fine. I tried to use GDB to issue commands to BMP directly, and it seems to work fine. At least I was able to connect, select elf, reset, start/stop/step the program manually. Though I don't quite know what commands pio sends when debugging and what command causes the crash.
If I go back in git history, previous versions of my code can be debugged properly, so the problem shows for a combination of specific source + BMP + PlatformIO.
At the moment I would like to not disclose the source code unless absolutely necessary, and it could be tied to my specific BMP hardware/software version. So it will be hard to reproduce, so I am prepared to do some troubleshooting myself (I vaguely remember having GDB communication somewhere in vscode output tabs, but it's not there now. It would be rather useful for troubleshooting).
Steps to Reproduce
Actual Results
The code is compiled, uploaded, a debugging section is started, "current line" is highlighted in source code editor (it's in initial assembly code)
The error appears in vscode debugging console, no further debug actions are possible except killing the debug session.
Full output of vscode Debug console
``` Reading symbols from d:\Documents\PlatformIO\Projects\motorboard\.pio\build\motorboard\firmware.elf... done. PlatformIO Unified Debugger -> https://bit.ly/pio-debug PlatformIO: debug_tool = blackmagic PlatformIO: Initializing remote target... Target voltage: 3.28V Available Targets: No. Att Driver 1 STM32G03/4 M0+ LL_mDelay (Delay=Delay@entry=1) at C:\Users\positron\.platformio\packages\framework-stm32cubeg0\Drivers\STM32G0xx_HAL_Driver\Src\stm32g0xx_ll_utils.c:183 183 while (tmpDelay != 0U) Loading section .isr_vector, size 0xb8 lma 0x8000000 Loading section .text, size 0x2f7c lma 0x80000b8 Loading section .rodata, size 0x1a0 lma 0x8003034 Loading section .init_array, size 0x10 lma 0x80031d4 Loading section .fini_array, size 0x4 lma 0x80031e4 Loading section .data, size 0x88 lma 0x80031e8 Start address 0x8001ba4, load size 12912 Transfer rate: 25 KB/sec, 717 bytes/write. Temporary breakpoint 1 at 0x8001ab0: file src\cube\Core\Src\main.c, line 73. Warning: the current language does not match this frame. PlatformIO: Initialization completed PlatformIO: Resume the execution to `debug_init_break = tbreak main` PlatformIO: More configuration options -> https://bit.ly/pio-debug Note: automatically using hardware breakpoints for read-only addresses. Remote failure reply: EE02000000000000FFFFFFFFFFFFFFFFD0020020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEE02000000200020DB1B0008B01A00080000006100200020FCFFFFFF00000000 ```