VS Arduino
Visual Micro >> Usb/Serial/WiFi Debugging >> Serial debugging wont start?
https://www.visualmicro.com/forums/YaBB.pl?num=1582034373

Message started by Bambo on Feb 18th, 2020 at 1:59pm

Title: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 1:59pm
Hi,

I'm trying to run the SoftwareSerial debugger however i get this message when i try to debug:


Quote:
Debug Build Error: This hardware might not support the default Visual Micro Debugger.
     If this project is using OTA/WiFi upload then please use the vMicro>Debugger menu to set the Serial COM and Remote port for the debugger.
     Otherwise switch the toolbar from 'Debug' to 'Release' and build again.
           or switch off Automatic Debugging
           or configure the SoftwareSerial debugger option.


For the software serial i have attached an FTD1232 to pins RX 21 and TX 10 on my board (they do not correlate to any hardware UART).

To upload the code i am using the SWD pins on the STM32 (TCK/TMS), which are on different pins to the serial debug port.

Here are my settings for the debugging:






I'm confused as to setting this up, i think i've configured it correctly but how can i define a Remote Port if the Remote Transport mode is SoftwareSerial? I'm not sure if this is the issue, please help!


Thanks!
Richard

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 2:16pm
Currently you have to set the software serial option in the visual micro project properties tool window.

You will see in the debugger section of the properties are the same properties you see on the vMico menu + some more.

Please see this documentation:-

https://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-With-Different-Ports.html

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 4:03pm
Ok thanks Tim, what do i use as the remote port when using the software serial mode? i've defined the Rx and Tx pins so shouldn't it be independant from any hardware/serial port?


But at the moment when i compile in debugging enabled mode i get this error?


Quote:
error: no matching function for call to
'VisualMicroDebug::begin(HardwareSerial*, int)


I'm using an STM32 Nucleo-64 L452RE

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 4:26pm
You are correct, you do not need to specify the remote port for software serial.

Software serial doesn't like 115200 speed, use 56k or below. Set the Remote speed and the local speed should automatically change to same.


Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 4:28pm
Ok, does the -g flag affect anything?

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 4:34pm
I've got some more errors from VM_DBG.h


Quote:
VM_DBG.h:396: note    candidate expects 1 argument, 2 provided
VM_DBG.h:397: note  candidate  void VisualMicroDebug  begin(SoftwareSerial*, long unsigned int)
   |                                                ^~~~~~~~~~~~~~~~
   397 |  void begin(SoftwareSerial *theSerial, unsigned long baud)
   |       ^~~~~
VM_DBG.h:397: note    no known conversion for argument 1 from HardwareSerial* to SoftwareSerial*
   397 |  void begin(SoftwareSerial *theSerial, unsigned long baud)
   |             ~~~~~~~~~~~~~~~~^~~~~~~~~


and also this too:


Quote:
sketch.ino: 112:68: error: no matching function for call to 'VisualMicroDebug::begin(HardwareSerial*, int)

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 4:54pm
Looks like software serial is broken in the last few versions. we will try to fix over the coming day or so.

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 5:11pm

Tim@Visual Micro wrote on Feb 18th, 2020 at 4:54pm:
Looks like software serial is broken in the last few versions. we will try to fix over the coming day or so.


Thank you Tim! 8-)

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 6:54pm
In recent builds the software serial debug failed for breakpoints outside of the project_name.ino however the error was different.

There is an updated build (20.02.16 sp1) but I suspect you settings are wrong and the current error you haveis probably unrelated.

Please confirm that you have not added a RemotePort=? Look at the vMicro>debugger properties and click the "Reset" option, then use the F4 project properties to set the RemoteTransport, LocalPort and tx/RxPins.



Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 8:55pm
Ok i have reset my debugger options and setup the RemoteTransport, LocalPort and Tx/Rx pins, and it all sets up correctly.

Problem is that its not printing anything to the port monitor if i set a breakpoint action or breaking the program at all if i hit the breakpoint?

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 9:00pm
I might need to see your zipped project but let's first make sure you are doing what you want to do.

Did you pick the softwareSerial debugger because you want to keep your code uses serial.read() on the main usb port?




Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 9:02pm
No, i'd like to use the nucleo-64 for the entire thing, the code does no serial reading.

I'm just checking if the program i'm running is running OK.

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 9:07pm
Clear/reset all the debug settings. Ensure the tool bar is set to "Debug". Add a breakpoint and click upload.

If the debug does not start then follow the guide in yellow above so we can see your settings.

There is nothing to configure for usb debug. The software serial option is something different.


Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 9:13pm
What do i set the Debug: Off/Serial/Hardware option to?

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 9:13pm
Please follow my previous request. I suspect there might be or or maybe two confusions

1) Debug is not enabled. Either automatic debugging has been switched off or the debugger type set to off. The guide in yellow above will show us what we need to know.

2) Debug is off and the serial monitor speed has been altered to be different from the speed set in the sketch code.

Let's see the output from the yellow box before continuing.

Thanks

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 9:22pm
Ok i can get the sketch to compile and then run, it enters the debug view, but nothing happens when it passes a breakpoint?

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 9:27pm
Normally you just switch the configuration name on the tool bar between Release and Debug. Visual Micro automatically switches the Serial debug off/on.

However you can override the automatic setting in which case you would need to ensure that "Serial" is the selected debugger type.

When the build happens it says "compiling project x" or in debug mode it says "compiling debug version of project x"

If you have been changing settings I recommend starting a new project with a simple test so that you can see a breakpoint work and also see that you need not change any settings other than switching between Release and Debug.

It is impossible to assist further without the information request in yellow above. Otherwise I have to guess at what settings you have changed.


See the docs

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 9:29pm
Ok no problem, sorry i'm just trying different configurations, it takes so long to build! I think that because its not printing to the Serial Monitor within vsmicro it must be that the port is setup wrong in the configuration.

Am i ok putting "PB7" "PB6" for example in the Rx and Tx pin boxes? what input do they expect?

The build log is as follows:
https://pastebin.com/T8ySUXZU

The micro debug trace output prints:
Launching Debugger...

The serial monitor prints:
Port closed
Opening port
Port open

--

Strange but the internal Serial window isn't printing anything i sent to it at all?

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 9:40pm
You have still got the softwareSerial configured which as I said is NOT what you want. You do not need to add a tx/rx pin you do not need to set any debug properties.

Please click the Reset on the vMicro>debugger menu then clear the value you have assigned to RemoteTransport in the project properties.

I can also see that you have switched off deep search for libraries. That is not causing an issue but will do in the future.

I think your big problem is the compile time. That is way too long and most certainly caused by your virus checker.

You could try exclusing this path from your virus checker or try with it off to see the speed difference.
C:/Users/Richa/AppData/Local/arduino15/packages/STM32

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 9:46pm
I've completely reset all the debugging settings so everything is empty. I pressed the debug button, but now it compiles and runs but no debugging happens at all?

This is the complete build log:
https://pastebin.com/KngCizj2

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 9:52pm
I've set some configurations to Serial, and to use HardwareSerial transport mode. I am trying to debug the STM through two pins PB7 and PB6, so i'm trying to setup the debugger to use those pins.

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 9:53pm
Okay great, it is possible you have switched off automatic debugging or manually changed the debug setting to Off. You have correctly selected the Debug configuration but the debugging is OFF.

All you need to do to switch on serial debug with all the default values is to set "vMicro>Debugger>Debug = Serial"



tip: The debug settings are remembered per configuration name. Therefore when you have "Debug" selected as a configuraton you can set what type of debugging to use, when you have Release selected, you can set the debug to Off. Then all you ever need to do it switch between Release and Debug.




Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 9:58pm
Ok now i'm trying again, all settings are reset to their default except the vMicro>Debugger>Debug = Serial setting.

But how will it know to use my specific PB7 and PB6 pins?

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 9:58pm

Quote:
I am trying to debug the STM through two pins PB7 and PB6, so i'm trying to setup the debugger to use those pins.


This is a confusing statement for me. previously you said you were just trying to use the standard usb cable that plugs into your board?

The debug settings we are discussing work with the same connection that your serial in your own code uses.


Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 10:00pm
No the setup i'm using is USB -> Nucleo-64 -> Dev board. I'm trying to debug with an FTDI1232 connected to pins PB7 and PB6.
i just think my problem is that it can't communicate p
roperly between the breakpoint hardwareserial code and the PC? I have set up the debugger to us Rx pin PB7 and Tx pin PB6, and also set the speeds to 9600 baud and also set the remote transport mode to HardwareSerial (which i hope goes HardwareSerial serial = HardwareSreial(PB7, PB6)). But the vmicro debugger still receives nothing?

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 10:02pm
Okay it is best to be clear when you make the initial posts. How does your serial work? Does you code use Serial, Serial1,Serial2 or SoftwareSerial?

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 10:04pm
The serial works like:


Code (c++):
HardwareSerial mySerial = HardwareSerial(PB7, PB6);

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 10:10pm
Oh i see what might be the issue, i use HardwareSerial here and manually define the Rx and Tx pins but the debugger only accepts the built in uart definitions. I can define the pins using SoftwareSerial but for some reason the stm32 l452re doesn't work using the software serial (i will double check this now).

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 10:17pm
Yes, when i try to use


Code (c++):
SoftwareSerial mySerial = SoftwareSerial(PB7, PB6);

The PC doesn't receive anything at all.


When i use:


Code (c++):
HardwareSerial mySerial = HardwareSerial(PB7, PB6);


The PC receives messages.

Strange?

--

So i guess to make it work, i would need an option to provide HardwareSerial the remote Rx and Tx numbers?

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 10:21pm
Using this https://github.com/stm32duino/wiki/wiki/API#hardwareserial i am going to try to re-map the Serial3 to my custom pins, and then point the debugger at the Serial3? hopefully it works

Title: Re: Serial debugging wont start?
Post by Bambo on Feb 18th, 2020 at 10:26pm
it worked!!!!

https://i.imgur.com/R0jqERR.png

To fix you must allow us to reconfigure the hardware serial parameters, but for now, a hotfix its just to re-wire the built in Serial definition like this:


Code (c++):
HardwareSerial Serial3(PB7,PB6);



and then configure the debugger like this:

Title: Re: Serial debugging wont start?
Post by Visual Micro on Feb 18th, 2020 at 11:08pm
Ah great. Thanks. We will try to extend the docs for that configuration.

Title: Re: Serial debugging wont start?
Post by Visual Micro on May 10th, 2020 at 12:40pm
Off-Topic replies have been moved to this Topic.

Title: Re: Serial debugging wont start?
Post by Visual Micro on May 23rd, 2020 at 5:59pm
Did we resolve this issue? There have been updates for both debug and stm32 in the latest releases(s) available here.

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


VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.