November 10, 2016 at 22:29 #9464
I wondered whether anyone here is using a Black Magic debugging probe with VisualGDB. I’m trying to get VisualGDB set up to use it and am having some trouble figuring out exactly how to pass the right commands to gdb. The probe uses a COM port for communication with gdb and does not need any middleware such as OpenOCD. I know which commands to send to it; that is all documented here: https://github.com/blacksphere/blackmagic/wiki/Useful-GDB-commands
My trouble lies in figuring out how to set up VisualGDB, starting with the Debug Method options. Do I need to use “Full-custom mode” or will “Custom GDB Stub” suffice?
As described on that wiki page referenced above, I need to enter two commands to connect to the target:
target extended-remote COM3
I can do this successfully by running arm-none-eabi-gdb in a command shell, but I’m having a hard time figuring out how to provide these commands to VisualGDB. It seems to have its own target-selection command which I cannot override.
Thanks in advance for any help or suggestions.
–AdamNovember 11, 2016 at 04:57 #9468
Please try switching the debug method to full-custom mode. Then specify the following:
Arguments –interpreter mi $(TargetPath) Working directory $(ProjectDir) Target selection command source connect.gdb Start command Assume the target is already stopped
Then create a file called connect.gdb in your project directory and paste the attaching commands there:C++12target extended-remote COM3attach 1
Then finally go to the Additional GDB Commands page and add the following post-target command:C++1loadAugust 29, 2017 at 01:11 #12202
I tried configuring debugging with the settings above, I can set a breakpoint at the beginning of main.
however if I step through I get an error. Given the logs, the program seems to have been loaded properly in flash.
“Received a SIGTRAP: Trace/breakpoint trap”August 29, 2017 at 04:37 #12206
Could you confirm that running the same gdb commands manually (in a gdb instance started from command line) works? If yes, please share the full gdb log (can be enabled on the Advanced GDB Settings page of VisualGDB Project Properties) and we will investigate.January 8, 2019 at 16:10 #23313
I confirm that BlackMagic Probe (made of blue pill) works fine with VisualGDB with v5.3r8. I use the following setup:
Debug settings page
Debug using: Full-custom mode
Arguments: -i mi $(TargetPath)
Working directory: $(ProjectDir)
Target selection command: leave empty
Additional GDB command page
Commands after selecting targer:
set mem inaccessible-by-default off
target extended-remote COM4
Without “set mem inaccessible-by-default off” VisualGDB is not able to read Hardware Registers, without “mon swdp_scan” BMP sometimes fails to attach.
The only feature I was not able to activate is Live Variables. In tutorial I found that this feature is for J-link only. But is there any way to activate this for BMP?
Attachments:You must be logged in to view attached files.January 8, 2019 at 21:46 #23318
Thanks for sharing this.
The Live Variables rely on the debug probe’s ability to provide an independent interface (completely parallel to GDB) for accessing the memory. Last time we checked, BMP did provide such an interface.
If anyone could patch the BMP sources to support a separate memory access interface, we will be happy to share instructions on creating a VisualGDB debug plugin to use it similarly to OpenOCD and J-Link.January 13, 2019 at 10:01 #23401
Are you going to implement Live Variable for Arduino in the latest version? BMP has separate uart port. Is it possible to make uart data as a source for Live Variables in Arduino style?January 13, 2019 at 19:15 #23404
Just a separate UART port won’t be sufficient for live variables. Some logic on the BMP side would need to handle the “read memory at address XXX” commands via this port, do the actual reading via JTAG/SWD and return the result.
Alternatively, we can add an API similar to the custom real-time watch that will let your program report arbitrary values via a connection such as a COM port, so VisualGDB will plot them.January 18, 2019 at 11:32 #23528
I suppose “Serial Plotter” feature, similar to that in Arduino IDE, would be useful. Especially for Arduino projects that you are currently implementing in VisualGDB.January 18, 2019 at 21:16 #23533
Yes, we will try to add something similar in one of the next major releases.May 9, 2021 at 14:49 #30480
I have a BlackMagic Probe V2.1 and want to use it with VisualGDB. I just found this entry but it won’t work. I have seen that there is a fork of OpenOCD with BlackMagic support. But I don’t know how to integrate this with VisualGDB.May 9, 2021 at 17:47 #30481
We would advise first getting it working with an instance of gdb manually launched via command line. Once you can confirm that it works reliably, feel free to let us know the tools and commands lines involved, and we will help you configure VisualGDB to replicate that setup.
You must be logged in to reply to this topic.