August 28, 2019 at 14:01 #25707
Just getting started with VisualGDB.
Using Visual Studio 19, c++, for an STM L4R5T project. A simple program – compiles ok – seems to load. But I can’t figure out how to single-step. When I run with debug – F10 & F11 are grayed out in the debug menu. Must be missing something!!
VisualMicro for Arduino uses same interface so I’m familiar with setting a breakpoint and including a message. Program hits breakpoint – but don’t see the bp message. Where is that displayed?
Also trying to use printf() to see results (this is just a learning program – size doesn’t matter!) – but do not know where printf is sending it’s text to.August 28, 2019 at 15:36 #25708
Normally F10 and F11 should work as usual. Perhaps the debug session doesn’t start properly, or the initial breakpoint doesn’t hit (i.e. the program is still running in the background)? If you are not sure, please try attaching a screenshot of the VS window with the step commands disabled and we will help you understand what is going on.
The printf() output should be redirected to Visual Studio as long as you reference the Advanced Semihosting and Profiling framework via VisualGDB Project Properties -> Embedded Frameworks, or enable the regular semihosting via the first page of VisualGDB Project Properties. Let us know if you need more details on this.August 29, 2019 at 13:53 #25713
Greets again! I did send some screen shots of the VS setup – but forgot to mention I’m working with a Nucleo-L4R5z board – and I guess the print output (either from breakpoint text or printf) would have to come thru the LinkV2/1 connector. I must be missing some setting to tell VS to write to that… Ideas?August 29, 2019 at 16:39 #25714
Thanks for sending us the screenshots. It looks like you are trying to step through the program while it is already running in the background, hence the “step” and “continue” commands are grayed out.
Please try setting a breakpoint in main() before starting the debug session and wait for the breakpoint to hit (a yellow arrow will appear inside the breakpoint symbol). Then you will be able to step through the program.
It also looks like you were trying to use the regular VS Project Properties instead of VisualGDB Project Properties and hence could not locate the Embedded Frameworks page. Please follow this tutorial for a detailed description of the steps required to enable semihosting.August 29, 2019 at 18:02 #25715
Ok – thanks – was using reg VS Project stuff. I’ve also added the block of code in the tutorial link, and I’m getting these errors:
Undeclared identifier “Bit_RESET”
I assume I’ll have to be adding that code-block to all future projects?
Just a side comment: I’ve worked with software/hardware for 40 years and never have come across anything so convoluted and arcane as this ARM HAL environment. EVERYTHING is not straight forward or intuitive… guess that is the price of speed! LOL!August 29, 2019 at 18:13 #25716
Sorry, simply copying arbitrary code snippets between projects will not always work, as there are several different types of projects, libraries and targets and not all of them are mutually compatible.
If you are new to the STM32 development, please consider following some of our STM32 tutorials step-by-step in order to familiarize yourself with common settings, project types and functions.
You must be logged in to reply to this topic.