First, apologies that I really don’t know much about GDB. Setting up toolchains is not my expertise, and generally I don’t think too much about how the debugger actually works, I just use it. PlatformIO seems to be just about as set-it-and-forget-it as embedded development gets these days, but alas, it’s not QUITE foolproof.
So I’ve got VSCode set up with PlatformIO on a macOS Mojave VM (to keep environment sanity until I set the toolchain up natively). I’m trying to debug a BluePill STM32F103.
Everything seems to work just dandy with minimal overhead, using an ST-LinkV2.
I’m trying to get a Black Magic probe working, since ultimately I’d like to use that going forward for the sake of supporting other targets. That has proved more difficult. Here’s my platformio.ini:
[env:bluepill_f103c8]
platform = ststm32
board = bluepill_f103c8
framework = arduino
;debug_tool = stlink
;upload_protocol = stlink
debug_tool = blackmagic
upload_protocol = blackmagic
debug_port = /dev/cu.usbmodemDFCEBEE51
upload_port = /dev/cu.usbmodemDFCEBEE51
When I click Go on “PIO Debug”, compilation goes smoothly:
Linking .pioenvs/bluepill_f103c8/firmware.elf
Checking size .pioenvs/bluepill_f103c8/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA: [ ] 1.3% (used 272 bytes from 20480 bytes)
PROGRAM: [= ] 10.2% (used 6692 bytes from 65536 bytes)
Building .pioenvs/bluepill_f103c8/firmware.bin
=============================================== [SUCCESS] Took 27.92 seconds ===============================================
Terminal will be reused by tasks, press any key to close it.
But over in debug console, just kinda… nothing happens:
Checking size .pioenvs/bluepill_f103c8/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA: [ ] 1.3% (used 272 bytes from 20480 bytes)
PROGRAM: [= ] 10.2% (used 6692 bytes from 65536 bytes)
========================= [SUCCESS] Took 3.13 seconds =========================
Reading symbols from /Users/alexw/Documents/PlatformIO/Projects/BlinkyTest/.pioenvs/bluepill_f103c8/firmware.elf...
PlatformIO Unified Debugger > http://bit.ly/pio-debug
PlatformIO: Initializing remote target...
Is my platformio.ini config wrong?