Troubleshooting Debugging an Arduino Sketch in vMicro

Note Icon Try This First:

Try the Hardware Debugger Troubleshooter page first.

Once completed, there is a selection of Tips below for specific issues, and these will make more sense after following the Troubleshooter.

 

 

 

 

If you have trouble getting the Hardware debugging, the below list of Error and Tips may help:

NOTE - this does not apply to the "GDB via Software" or "vMicro Serial Debugger" options

Failed to Connect to Debugger

 


Software

Ensure your project does not have spaces in the name (i.e. is Arduino Compatible)

This can cause issues when passing the parameters through to the debugger in some configurations.

Ensure your sketch is not using any of the Debugging Pins

e.g. on the ESP32 you cannot use pins 12,13,14,15 in your sketch as these are needed solely for debugging.

It has been occasionally seen in VS2019 that the toolsets may not always download automatically.

The toolset archives can be downloaded from the links below manually:

OpenOCD (non-ESP32): 

https://www.visualmicro.com/downloads/tools/openocd-0.10.0.1/openocd-0.10.0.1.zip

https://www.visualmicro.com/downloads/tools/openocd-0.10.0.20200213/openocd-0.10.0.20200213.zip

OpenOCD ESP32:

https://www.visualmicro.com/downloads/tools/openocd-espressif-esp32-10.0.1/openocd-espressif-esp32-10.0.1.zip 

This needs extracting to "C:\Program Data\vMicro\tools\", and after this you should be able to see files in the folder,

E.g. "C:\Program Data\vMicro\tools\openocd-0.10.0.1\bin" folder should be "openocd.exe" and a number of dll files.

The debugger should start once these files are in place, if there are no other issues...

 


Connections

Are all wires connected as directed in the diagrams? Its always worth checking as this will prevent any debugging working.

Are your Wires as short as possible?
Wires should be 10CM or less to ensure reliable connectivity between the probe and the debugger

Are your Wires running past any other devices/power leads/USB Leads?
It is best to avoid the JTAG lines and devices running over or being too close to other signal or power lines which can introduce noise into the lines.

Is the ribbon cable the right way around?

Example 20 Pin JTAG Ribbon cable with (D)ebugger and (T)arget marked

Example 20 Pin JTAG Ribbon cable with (D)ebugger and (T)arget marked


Example 10 Pin SWD Ribbon cable with (D)ebugger and (T)arget marked

Example 10 Pin SWD Ribbon cable with (D)ebugger and (T)arget marked

 

Also check the diagrams from the links on our debugger list here


Power

Do both the debugger and target board show their power LED's when both are connected to the PC and each other as needed?

You may still need to supply additional power to your target (via USB lead or power pins direct)

If they both work until they are connected together, then you have a short somewhere in the connections (check VCC/GND specifically)

Driver Installations

Have you installed the manufacturers' drivers?

Did you need to replace the Interface 0 driver? (check the debugger list for your debugger)

To manually check if the debugger is connecting:

  1. Open the Output Window and select "Show Output From: Debug"
  2. Select the first command (everything after 'Starting: ')
  3. Open a new command line (cmd.exe)
  4. Paste in the command and run it
  5. Inspect the output
    Command Prompt Output when no OpenOCD Driver is present

If you see output similar to above "unable to open device with vid" then check your driver, and any additional driver installation


Port Selections

Black Magic - You need to select a different port in vMicro to connect to the debugger compared to your board, if not using the debugger to perform the upload.

All other debuggers are identified via a mechanism which does not require a COM port, but relies on the drivers installed (see above)


Code Upload to Board

If you see the below message, that you have "Debug" configuration selected at the top of the IDE, and you have uploaded your code to the board

If the code is definitely uploaded, and IDENTICAL to what you are debugging, just perform a build, and then attach.

Further Errors

One reason you see the below if all drivers, and connections between your boards and the PC are OK, but the connections between the debugger and the target are failing.

 

ESP32 - Missing TDI Wire Connection

The example below is for an ESP32 with a Segger J-Link, and will appear as below if the TDI wire is not connected (pin 12 on your ESP32)

CMD output for OpenOCD command where TDI is not connected. Watch for TAP auto.tapX does hot have IDCODE

 

Swapping Without Re-Powering

If you are swapping between a variety of targets and debuggers within a session, ensure you power down both the debugger and the target before changing the connections.  This ensures that everything works as expected when re-powered, and no previous running configurations can conflict.

 

Restart Target

If the debugger starts and connects, but you never land on your breakpoint..... stop the session, and reboot the target board using its reset button.  Try connecting the debugging session again, it should now work as expected...

 

Cannot Upload and Debug

In some cases you can no longer upload to the target via serial when the debugger is connected.

In this scenario, unplug one end of the ribbon cable (or JTAG connections), perform the serial upload, then attach it again. 

Then press "Debug" > "Attach To Process"

 

Further information will be added to this page as it is identified, so do check back with us....

 

_