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 3917 times)
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #20 - Oct 8th, 2020 at 11:35am
Print Post  
Ok, setting Remote Transport to FastSerial it compiles also in compile mode.
But there is no difference in the output screens between compiling in Release and Debug modes (changing nothing else).

Anyway, is it possible to watch the PC13 port registers or what else from that port?

« Last Edit: Oct 8th, 2020 at 11:36am by arduino1 »  
Back to top
 
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #21 - Oct 11th, 2020 at 10:06am
Print Post  
When tagging "Monitor digital" and "analog pins" in Debugging options just the USB port used for uploading is shown.
Can other open GPIO ports like PC13 being monitored ?
  
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 #22 - Oct 11th, 2020 at 1:37pm
Print Post  
The serial debugger can debug on any built in "Serial" such as Serial1, Serial2 or it can use SoftwareSerial.

This document shows how to use SoftwareSerial. In short, you just need to set the Transport=SoftwareSerial, LocalSpeed to 56k or less, then enter one or two pins into RemoteTx and RemoteRx and set the LocalPort to the COM that connects your usb to pins. (Do NOT set the RemotePort that is for special advanced use). Use simple Arduino numbers in RemoteTx and RemoteRx such as RemoteTx=5 and RemoteRx=6

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

NOTE: Depending on your board, SoftwareSerial works better if the pins are interruptable. Set the LocalSpeed to 56k or less. Most boards have serial data corruption with softwareSerial over 56k.
« Last Edit: Oct 11th, 2020 at 1:41pm by Tim@Visual Micro »  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #23 - Oct 11th, 2020 at 4:46pm
Print Post  
OK, thank you, will try. So "Serial Debugger" means Debugger for serial ports.... of course.

You mentioned to consider to implement the peripheral port monitor sometimes.
Is there a timeline?
  
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 #24 - Oct 11th, 2020 at 5:23pm
Print Post  
Yes Serial means any type of Serial and that can also include wifi some board. It's difficult to find the right words. 

Really there is hardware debugging (GDB) and then there is "Serial" debugging which is actually software debugging that uses injected debug statements during the build process. We don't currently call the Serial debugging "software" because it is too easily confused with SoftwareSerial which is just one of the "Serial" options.

Too many Software and Serial words Smiley

What do you mean by "peripheral port monitor". Maybe you are asking about our wifi debugging for esp8266 and esp32 or something else?
« Last Edit: Oct 11th, 2020 at 5:25pm by Tim@Visual Micro »  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #25 - Oct 11th, 2020 at 7:45pm
Print Post  
At present I am working (better struggling) with the Blue Pill. I am adapting the famous STM32_O_Scope to my data acquisition needs having to add rotary encoders, switches, Pots etc. No WiFi.
I had done that very successfully with the ATXmegas, mainly using Bascom compiler.
The XMega became too small and therefore I considered the STM32s. In principle the Arduino IDE would do it, but debugging is quite limited. So I came to the messy world of STM32 development systems from Cube's to Visual Studio's. I am telling my friends that I have doubts that anyone can be productive these times with those complex development systems with hundreds of potentially changing dependencies... A code running the day sometimes was not running the next morning after everything had rebooted.

Vmicro is nice but it were wishable to have the target under full control, being able to look at the hardware registers like in this screenshot.
« Last Edit: Oct 11th, 2020 at 7:46pm 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 #26 - Oct 11th, 2020 at 8:03pm
Print Post  
Yes you can do that with the Hardware debugger options in Visual Micro. The hardware debugger gives ability to step and also to inspect and change all values live.

The serial debugger is simpler and easier for newer users and imporves productivity for all but more advanced needs. It is also stronger than hardware debugging for high speed trace and plotting.

Both types of debugger are available in Visual Micro.

See the Debugging tab on this page, scroll down for hardware debug via STlink pins.

https://www.visualmicro.com/page/STMicroelectronics-STM32-Overview.aspx

or take a look at this page for STM32 debugger support.

https://www.visualmicro.com/page/STM32-Debugging.aspx

See the "Docs" link at the top of visualmicro.com for more info

Documentation Index

This image shows hardware debug but OI couldn't find an image that shows the Watch expressions (objects) that can be expanded and explored. Try it out there is lots of featues to explore. The digital outputs aren't as pretty as some tools, such as Atmel Studio, but the values are visible. You can right click the code and "Add Watch" or right click the Watch list and "Add Watch". All data types are supported such as array and object.

« Last Edit: Oct 11th, 2020 at 8:53pm by Tim@Visual Micro »  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #27 - Oct 12th, 2020 at 12:18pm
Print Post  
Ok, so I am back where I had been weeks ago: Debugging doesn't work anymore, using Jlink. The sketch runs, however.
See the outputs from Debug and Microbuilt.

Could you also post the code you were using in that example?
  

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 #28 - Oct 12th, 2020 at 12:44pm
Print Post  
Could you also attach the below log file, just so we can see the OpenOCD Logging too?
Code
Select All
_vmicro.ino_DebugOpenOCD.log 

  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #29 - Oct 12th, 2020 at 1:49pm
Print Post  
Ha, quite simple message.
swd
Warn : Failed to open device: LIBUSB_ERROR_NOT_SUPPORTED.
Error: No J-Link device found. 

Zadig? What should it be?
  

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 #30 - Oct 12th, 2020 at 2:14pm
Print Post  
To work with our OpenOCD Setup it needs to be the WinUSB (v6.1.7600.16385) as shown on the right of the image.

NOTE - To use it afterwards with the Native JLink Tools (and potentially other software) this needs to be rolled back using their package to re-install the JLink driver you currently have.
  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #31 - Oct 12th, 2020 at 3:04pm
Print Post  
Using Jlink+Vmicro OCD I get the attached error.

Using just Jlink it asks for Identifier.
  

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 #32 - Oct 12th, 2020 at 3:45pm
Print Post  
Before we move onto Uploading - Does the Debugging now work using JLink and OpenOCD, now the driver has been updated?

The JLink software works differently. If you have more than one JLink plugged in at a time, there are additional parameters which can be passed to specify which JLink to use, if that is the case?
  
Back to top
IP Logged
 
arduino1
Junior Member
**
Offline


Posts: 75
Joined: Feb 12th, 2015
Re: How to debug Serial
Reply #33 - Oct 12th, 2020 at 4:00pm
Print Post  
No, after updating the driver by Zadig as you suggested it did not work, I got the "OPENOCD" error log as shown in previous post.

Update: Just one Jlink
« Last Edit: Oct 12th, 2020 at 6:59pm by arduino1 »  
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 #34 - Oct 14th, 2020 at 5:13pm
Print Post  
This Topic was moved here from Usb/Serial/WiFi Debugging [move by] Visual Micro.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint