Okay.
A little progress.
Here are my findings. My BMP wasnt able to upload the bluepill board no matter what I did, forget debugging.
All I got was an error “SWDP_Scan Failed!”
On going through this post
http://www.stm32duino.com/viewtopic.php?t=1614
I realised, that the arduino port for the STM32, by default, disables the SWD functionality for the sake of GPIO functionality
. So no matter what debugging tool you use SWD debugging and or uploading is not possible.
The fix is given in the replies below. Either place the bluepill in Serial bootloader mode, reset and it uploads fine via BMP or fix the build flags in the platformio.ini file.
Adding this,
build_flags = -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1
to the platformio.ini file will allow you to override the stm32 arduino build and enable the SWD pin functionality.
SWD debugging using any compatible adapter works afterwards.
I was able to debug as shown, but soon ran into the problem as explained here.
https://community.platformio.org/t/platformio-debugging/1704/3
I too get the same errors sometimes when I try to debug, further while the variables are shown in the watch window, any incrementing of the variables in code does not reflect in the watch window.
I ll keep digging and see what else I can do to fix the debugging issue. I suspect it has nothing to do with the platformio but more to do with gdb. A quick google search reports that these issues are common even in eclipse (on X86 platforms, I did not check if any results contained references to any embedded platforms)
Maybe another day or so and I should have an answer for the debugging issues too.
Hope this helps someone reduce their frustration.
(Please excuse any grammatical errors, Its almost 3 AM here and I spent the last 5-6 hours trying to understand and resolve this issue. Highly tired and sleep deprived)