Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Unable to start debugging - STM32 VS2019 (Read 395 times)
mark4321
Newbies
*
Offline



Posts: 5
Unable to start debugging - STM32 VS2019
Jul 30th, 2019 at 6:01am
 
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 Hopkinson
Administrator
*****
Offline



Posts: 40
Re: Unable to start debugging - STM32 VS2019
Reply #1 - Jul 30th, 2019 at 9:18am
 
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
Re: Unable to start debugging - STM32 VS2019
Reply #2 - Jul 30th, 2019 at 11:01am
 
Thanks for the response Simon. Attached is the output from a clean build.
Back to top
 

 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 40
Re: Unable to start debugging - STM32 VS2019
Reply #3 - Jul 30th, 2019 at 12:14pm
 
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:
build.openocdscript=target/stm32f1x.cfg 

Back to top
 
 
IP Logged
 
mark4321
Newbies
*
Offline



Posts: 5
Re: Unable to start debugging - STM32 VS2019
Reply #4 - Aug 1st, 2019 at 2:46am
 
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
 
Visual Micro
Administrator
*****
Offline



Posts: 10395
United Kingdom
Re: Unable to start debugging - STM32 VS2019
Reply #5 - Aug 4th, 2019 at 4:19pm
 
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
Re: Unable to start debugging - STM32 VS2019
Reply #6 - Aug 5th, 2019 at 8:19am
 
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.
Back to top
 

Micro_build_2.txt (43 KB | 5 )
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10395
United Kingdom
Re: Unable to start debugging - STM32 VS2019
Reply #7 - Aug 5th, 2019 at 4:25pm
 
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
Re: Unable to start debugging - STM32 VS2019
Reply #8 - Aug 6th, 2019 at 3:39am
 
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 Topic Print