Arduino Serial/WiFi Debugging - Performance and State Monitoring

The Serial Debugger for Arduino helps monitor the performance of your embedded system, allowing near realtime charting of memory usage, as well as performance monitoring of tracepoints.

This is only supported using the Serial Debugger because Hardware Debugging impacts the system too heavily to be used for performance monitoring.

 

Warning 16 Warning performance monitoring cannot exceed the serial rate your PC can handle.

 

Variable Monitoring

The Expression Window shows the actual values of all the variables mentioned in the message strings.

Each time a breakpoint is hit, the respective values will be updated in the Expression Window, with Min and Max allowing quick and simple calibration of sensors.

Expression Window

Right click on the column headers to add additional features into the Expression Window.

Further information about using the Expression Window for variable monitoring can be found here

Free Memory Monitoring

This can be enabled using the Debugger > Monitor Free Memory Option.  Once the debugger starts, the chart will automatically appear in the IDE for you (as below):-

Free Memory Monitor Chart in vMicro

The "Interval (ms)" option seen here is the frequency the chart is updated at, the data polling speeds are explained in the following sections.

 

Custom Break / Trace Messages

Add messages and/or {variables} and {function()} to break-points via 'break-point>action>message'

Add =? to the end of a variable name to enable update of the variable value during a debug session: ie: "Motor volts: {myVar=?}"

Tracepoint with custom message and variable tracking

 

Performance Monitoring

Performance Monitoring will add timing statistics to all breakpoints, which can be seen in the output window.  This will show the total uptime, as well as the time elapsed between this breakpoint and the previous one hit.

This can be enabled from Debugger > Performance Monitoring, and a walkthrough of using this feature to find slow code can be found on the Identifying Bottlenecks with Performance Monitoring page.

Output Window with Performance Statistics

 

Tracepoint Timing

To set the tracepoint to output periodically use milliseond values in the "breakpoint > conditon > hit counter"

e.g. Multiples of 250 would be 4 debugger updates per second

vMicro TracePoint with Hit Counter Settings

If you wish this to become a different interval instead of the default of ms you can edit the "Report Frequency Type", and to alter the default interval use the "Report Frequency"

vMicro > Project Properties > (Micro Debug Reporting Section) > Report Frequency Type / Report Frequency

vMicro Serial Debugger Project Options

Warning 16 Warning If you set the Type to "No Filter" you need to ensure your code will not overload the Serial port on your PC, with either HitCounts as above, or delays in the code.

More Information can be found about Using Breakpoint and Tracepoint Hit Counters and Conditions

 

Pin Monitoring

vMicro will automatically monitor all pins on your board, and create a visualisation to make it simpler to analyse.

These can be enabled from the Debugging > Monitor Analog / Digital Pins options, or by including a tracepoint in your program with {@ReportDigital} and / or {@ReportAnalog}

Digital and Analog Pin Visualisations in vMicro


 

Custom Charting

Include special vars such as  {@Plot.MyWindow.MyChartName sensor1Value} to plot custom values on to your own charts, to track whatever is needed in your project...

Learn more detail, and watch an example video of Drawing Graphs Using @Plot Windows.


Crash Exception Decoder

If your ESP board is crashing, you may be able to use the exception decoder to understand the issue further.  How to use this and further advice can be found here.