Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Unable to start debugging - STM32 VS2019 (Read 4437 times)
mark4321
Newbies
*
Offline


Posts: 5
Joined: Jul 30th, 2019
Unable to start debugging - STM32 VS2019
Jul 30th, 2019 at 5:01am
Print Post  
I have been trying to get debugging to work with a very simple setup but with no success so far. The hardware is an STM32 blue pill board (STM32F103C8) with a ST-Link v2 using the SWDIO and SWCLK lines along with 3v3 and GND. I have generated a simple blink application toggling the LED on PC13. This works fine when I download the compiled binary. The software environment is Visual Studio 2019 (latest update 16.2.0) and Visual Micro (latest update 1907.29.3) on Windows 10. (I have been trying to get this to work for a couple of weeks on and off so have tried previous versions with no luck. I just updated to the latest VM in the hope that the problem might be fixed but sadly no difference) I have set up the visual micro environment to generate a debug binary and am using hardware debugging. When I try to start the debugging session the code is downloaded to the hardware however I get a vs dialog  "Unable to Start debugging. Unable to establish a connection to GDB. Debug output may contain more information". So I had a look at the debug output and see the openocd command line which is apparently trying to execute but exits with error code 1 (0x01). Closer inspection of the command line shows a log file being generated /Blink1.ino_DebugOpenOCD.log where the log file name is preceded by the temp directory below the AppData directory. The log file contains what I assume is the issue in the following "embedded:startup.tcl:60: Error: Can't find C:\ProgramData\vmicro\tools\openocd-0.10.0.1/scripts/{build.openocdscript}
in procedure 'script' 
at file "embedded:startup.tcl", line 60"
It is at this point I am stuck. I am not sure what {build.openocdscript} should expand to in the  "C:\ProgramData\VMicro\tools\openocd-0.10.0.1\scripts" directory. I am also assuming at this stage that Windows 10 is not to bothered by the \ versus / separators. Any clues that might point me to a resolution of this would be greatly appreciated. What should be a simple exercise according to the visual micro website GDB debugging description is turning out to be far from that.

Thanks in anticipation. Mark
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2143
Joined: Feb 13th, 2019
Re: Unable to start debugging - STM32 VS2019
Reply #1 - Jul 30th, 2019 at 8:18am
Print Post  
Would it be possible to attach the debug output from the build (explained in yellow box at top of page).   

This will help us identify what is happening for this configuration more easily.

  
Back to top
 
IP Logged
 
mark4321
Newbies
*
Offline


Posts: 5
Joined: Jul 30th, 2019
Re: Unable to start debugging - STM32 VS2019
Reply #2 - Jul 30th, 2019 at 10:01am
Print Post  
Thanks for the response Simon. Attached is the output from a clean build.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2143
Joined: Feb 13th, 2019
Re: Unable to start debugging - STM32 VS2019
Reply #3 - Jul 30th, 2019 at 11:14am
Print Post  
Thanks for the detail, there is something missing in our configurations around this.

For now if you right click the project > Add > Add Local Board.txt

Then paste in the line below and save the file, and try attaching again, it should work as expected.

Code
Select All
build.openocdscript=target/stm32f1x.cfg 

  
Back to top
 
IP Logged
 
mark4321
Newbies
*
Offline


Posts: 5
Joined: Jul 30th, 2019
Re: Unable to start debugging - STM32 VS2019
Reply #4 - Aug 1st, 2019 at 1:46am
Print Post  
I made the change you suggested however am still unable to start the debugger. I still get the vs dialog "unable to start debugging. unable to establish a connection to GDB." I checked the log file and now get the error message "Error: Debug adapter does not support any transports? Check config file order.
Error: unable to select a session transport. Can't continue.
shutdown command invoked"

I have tried this with two different configurations, both with the same result. The first configuration is using a stm32f103c8 blue pill with a chinese st link v2 connected via a 4 pin 3v3, SWDIO, SWCLK and GND connector. The second configuration is using a genuine ST-link v2 connected via a JTAG cable to a st32f103c8 board with a 20 pin JTAG connector. Both configurations program the device with no issues and both configurations give the same error when trying to run the debugger. Both of the st links are updated to the latest firmware. Thanks for your help so far.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unable to start debugging - STM32 VS2019
Reply #5 - Aug 4th, 2019 at 3:19pm
Print Post  
Please try the latest release currently 1908.4.0

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Simon made some improvements but they are not i the gallery yet. 

You should not need any local board.txt properties. This might help but if not then please follow the guide in yellow above. Then click debug>attach. After you see the debug error switch the output window to "Micro Build" and copy the output into a .txt so we can see it.

Thanks
  
Back to top
WWW  
IP Logged
 
mark4321
Newbies
*
Offline


Posts: 5
Joined: Jul 30th, 2019
Re: Unable to start debugging - STM32 VS2019
Reply #6 - Aug 5th, 2019 at 7:19am
Print Post  
I installed the latest VM build. Unfortunately I still get the 'unable to start debugging' dialog after downloading the binary to the target and attempting to attach to the process. I have attached the micro build output. Thanks.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unable to start debugging - STM32 VS2019
Reply #7 - Aug 5th, 2019 at 3:25pm
Print Post  
Sorry, we might finally have fixed the issue in 1805.5.1 see LATEST here

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Thanks
  
Back to top
WWW  
IP Logged
 
mark4321
Newbies
*
Offline


Posts: 5
Joined: Jul 30th, 2019
Re: Unable to start debugging - STM32 VS2019
Reply #8 - Aug 6th, 2019 at 2:39am
Print Post  
It now appears to be working correctly. I have tried it on both the simple blink example and a much larger project I have been working on. I can run the debugger on both. Thanks for your help.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint