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] 2  Send TopicPrint
Very Hot Topic (More than 25 Replies) How to debug Serial (Read 3922 times)
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
How to debug Serial
Oct 6th, 2020 at 3:07pm
Print Post  
Tried to debug serial on Blue Pill connected via USB with STM32duino bootloader flashed.
First I try uploading in release mode. I chose Generic STM32F103C series, Variant ...128K (device has that).
Uploading works.

Then I switch to Debug. 
By magic the device is changed to Generic STM32F1 series, subdevice Blue Pill 103C 
and I can no longer chose Serial for Uploading.
Rather the Maple DFU bootloader (and other hardware devices) are offered.
So, shall one flash different bootloaders when switching from Release to debug?????

  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: How to debug Serial
Reply #1 - Oct 6th, 2020 at 3:29pm
Print Post  
Thanks for the report.

Do you have the below option enabled?
vMicro > General > "Save Board, Port and Programmer for Each Configuration"

If yes, you will need to re-select the board, port and programmer when switching from Release Configuration to Debug Configuration for the first time.

Further information can be found on the Visual Micro Build Configurations Page.
  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #2 - Oct 6th, 2020 at 3:56pm
Print Post  
Then this happens:
see attachment
  

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


Posts: 2704
Joined: Feb 13th, 2019
Re: How to debug Serial
Reply #3 - Oct 6th, 2020 at 4:14pm
Print Post  
You have the Debug set to Serial (vMicro > Debugger > Debug: Serial), if you change this to OFF it should build as expected.

If you are trying to use the Serial Debugger, it seems the vMicro > Debugger > Advanced ... > Remote Port has been set to "SerialUSB", which is not needed for the Blue Pill.
  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #4 - Oct 6th, 2020 at 4:55pm
Print Post  
When I switch on Debug, but off debug:serial, it compiles, but a breakpoint is not being served.
No window for monitor digital pins. Vmicro just finishes.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: How to debug Serial
Reply #5 - Oct 6th, 2020 at 5:04pm
Print Post  
Thanks, as you are trying to use the Serial Debugger, this will need to be set to Debug: Serial again.

Then ensure that the Advanced option shown in the previous post has not been set to SerialUSB.

  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #6 - Oct 6th, 2020 at 7:02pm
Print Post  
Thanks, did so, but then:
VM_DBG.h: 73:28: fatal error: SoftwareSerial.h: No such file or directory
   #include <SoftwareSerial.h>
   compilation terminated
I found and scattered that library to several folders and restarted Studio.
Didn't help. Error:
VM_DBG.h:73: In file included from
Blink.ino: from
SoftwareSerial.h: 27:43: fatal error: circular_queue/circular_queue.h: No such file or directory
   #include "circular_queue/circular_queue.h"
« Last Edit: Oct 6th, 2020 at 7:03pm by arduino1 »  

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


Posts: 2704
Joined: Feb 13th, 2019
Re: How to debug Serial
Reply #7 - Oct 6th, 2020 at 8:52pm
Print Post  
The Software Serial Library isn't available in Roger Clark's STM32 core libraries, so isn't available to build for the debugger in this instance.

Do you have a user library installed for Software Serial it should be finding?

(The official Stm32duino core does however contain a version of the Software Serial Library, but it may be incompatible with the other core...)
  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #8 - Oct 7th, 2020 at 9:18am
Print Post  
Wow. It was a lot of work (the whole morning) to direct Arduino to the right Softwareserial library.
Maybe this is of interest to you also: Softwareserial for the Maple core
https://www.hackster.io/rayburne/color-barometric-extension-to-gps-date-time-clo...

By now Serial Debug is working when compiling in Release mode. 
The Debug mode throws error, is that being meant that way?

The digital pins being monitored are just those from the com port used for uploading.
How to see the digital pins from e.g. PC13 in the blink example?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: How to debug Serial
Reply #9 - Oct 7th, 2020 at 3:37pm
Print Post  
Thanks for the information about the library, we will give it a go.

Can you attach the logs for compiling in Debug mode and in Release Mode so we can understand and compare further?

The digital pin monitor can be enabled from the vMicro > Debugger > Monitor Digital Pins option.
  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #10 - Oct 7th, 2020 at 6:56pm
Print Post  
Have a look please.
  

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to debug Serial
Reply #11 - Oct 7th, 2020 at 7:00pm
Print Post  
Please add screen shot of vMicro>Debugger menu when Release is selected and one when Debug is selected.

Thanks
  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #12 - Oct 7th, 2020 at 7:45pm
Print Post  
Voila
  

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to debug Serial
Reply #13 - Oct 7th, 2020 at 7:47pm
Print Post  
Those are tool bars Smiley

Please add screen shot of vMicro>Debugger menu when Release is selected and one when Debug is selected.
  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #14 - Oct 7th, 2020 at 8:05pm
Print Post  
new
  

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to debug Serial
Reply #15 - Oct 7th, 2020 at 9:01pm
Print Post  
Thanks and also a screen shot of the debug project properties for the one that fails like the one below.

  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #16 - Oct 8th, 2020 at 6:49am
Print Post  
there.
« Last Edit: Oct 8th, 2020 at 6:50am by arduino1 »  

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to debug Serial
Reply #17 - Oct 8th, 2020 at 7:37am
Print Post  
So now you see the difference? The build error mentions serialUSB is unknown and for some reason you have entered it as a value.
  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #18 - Oct 8th, 2020 at 10:52am
Print Post  
Release compiles, Debug doesn't, recommends using Release.
The settings to get it working look little unexpected (Release, Debug:Serial?).

Anyway, is it possible to watch PC13?
void loop() {
  digitalWrite(PC13, HIGH);   // turn the LED on (HIGH is the voltage level)

  

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to debug Serial
Reply #19 - Oct 8th, 2020 at 11:18am
Print Post  
Why set serial as local port when trying to use software serial?
Why post two unrelated screen shots?
Why have you not made your debug settings same as release which works?

Please only ask one question at a time so you can focus on the answer.

I think you have the capability to resolve by undoing the incorrect settings you have added.
« Last Edit: Oct 8th, 2020 at 11:19am by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint