VS Arduino
Visual Micro >> Hardware Debugging (GDB, GDB WiFi, GDB Stub) >> New user trying to get hardware debug to work
https://www.visualmicro.com/forums/YaBB.pl?num=1583433775

Message started by chico on Mar 5th, 2020 at 6:42pm

Title: New user trying to get hardware debug to work
Post by chico on Mar 5th, 2020 at 6:42pm
Hi - Just getting started with VisualMicro on ESP32. I can get it to work fine with serial debug, but am struggling with hardware debugĀ on Windows 10.

I'm using a TIAO USB Multifunction Board. I believe I've got the JTAG connector wired to the correct ESP32 pins. I think I should be using the TUMBA config script, but I couldn't find how to select that script. So I copied the TUMBA config script ("/ftdi/tumpa.cfg") to "/ftdi/minimodule-lowcost.cfg" and selected that in VisualMicro.

Here's the output from Visual Micro after "Debug>Attach to process"):

[code]Starting: "C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1\bin/openocd.exe" -d2 -l "{C:\Users\jduncanson\AppData\Local\Temp\VMBuilds\JayzVisualStudioTestSketch\esp32_node32s\Debug/JayzVisualStudioTestSketch.ino_DebugOpenOCD.log}" -s "C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1/share/openocd/scripts/" -f "C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1/share/openocd/scripts/interface/ftdi/minimodule-lowcost.cfg" -c "set ESP32_RTOS none" -f "C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1/share/openocd/scripts/board/esp-wroom-32.cfg" -c "init"
Starting: "C:\Users\jduncanson\AppData\Local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0/bin\xtensa-esp32-elf-gdb.exe" --interpreter=mi -ex "set remote hardware-watchpoint-limit 2" -ex "mon reset halt" -ex "flushregs" -ex "thb app_main" -ex "c"
"C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1\bin/openocd.exe" exited with code 1 (0x1).[/code]

Can anyone tell me if this looks like a driver issue, or if I've selected the wrong script, or anything else about how I should go about getting things to work? The "exited with code 1" error message doesn't give me much direction...

Thanks...

Title: Re: New user trying to get hardware debug to work
Post by Simon Hopkinson on Mar 5th, 2020 at 7:48pm
Thanks for the information, could you post the file below back?
(this is created by the -l "{logfile}" part of the first command for OpenOCD in your post).
[code]
C:\Users\jduncanson\AppData\Local\Temp\VMBuilds\JayzVisualStudioTestSketch\esp32_node32s\Debug/JayzVisualStudioTestSketch.ino_DebugOpenOCD.log[/code]

Title: Re: New user trying to get hardware debug to work
Post by chico on Mar 7th, 2020 at 8:54pm

Simon@Visual Micro wrote on Mar 5th, 2020 at 7:48pm:
Thanks for the information, could you post the file below back?
(this is created by the -l "{logfile}" part of the first command for OpenOCD in your post).

Code (]
C:\Users\jduncanson\AppData\Local\Temp\VMBuilds\JayzVisualStudioTestSketch\esp32_node32s\Debug/JayzVisualStudioTestSketch.ino_DebugOpenOCD.log[/code):



Yes, here it is:

[code]none separate
none
adapter speed: 2000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Error: libusb_open() failed with LIBUSB_ERROR_NOT_FOUND
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 8a98, description '*', serial '*' at bus location '*'
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description '*', serial '*' at bus location '*'

Warn : Flash driver of esp32.flash does not support free_driver_priv()
Warn : Flash driver of irom does not support free_driver_priv()
Warn : Flash driver of drom does not support free_driver_priv()


More info: I used the driver that was pointed to on the DIYGadget site where I purchased the TUMPA (TIAO Universal Multi Protocol Adapter): TIAO_TUMPA_CDM_v2.12.24_WHQL_Certified

Also, I should mention I'm using X86 Windows 10, if that is an issue (Version 10.0.18362 Build 18362).

Title: Re: New user trying to get hardware debug to work
Post by Simon Hopkinson on Mar 9th, 2020 at 12:08pm
Thanks, the "unable to open ftdi device with vid / pid" means it cannot identify the debugger, which in our setup often means the debugger does not have the correct driver installed for our software.

If you download the Zadig tool, and then select Options > List All Devices, Find "Interface 0" of your debugger (if it has > 1 listed), and install the WinUSB Driver, this should resolve this issue.

This video also walks through installing the Zadig Driver for a debugger similar to this one (FTDI based).

Title: Re: New user trying to get hardware debug to work
Post by chico on Mar 9th, 2020 at 9:29pm

Simon@Visual Micro wrote on Mar 9th, 2020 at 12:08pm:

If you download the Zadig tool, and then select Options > List All Devices, Find "Interface 0" of your debugger (if it has > 1 listed), and install the WinUSB Driver, this should resolve this issue.

This video also walks through installing the Zadig Driver for a debugger similar to this one (FTDI based).


Thanks so much! Installing the suggested driver got things working.

To get the TUMBA board to work, I copied the TUMBA config file contents to the F2232 Mini Module config file so that I could select it from the Visual Studio menu. How could I make the original TUMBA.cfg file appear in that menu, so I don't have to perform this minor hack?

Title: Re: New user trying to get hardware debug to work
Post by Simon Hopkinson on Mar 10th, 2020 at 10:48am
Glad to help, and there are two options for the amendments:

1) Add a board.txt to the project and add the below entry for the debugger config, leave the "F2232 MiniModule" Selected still
[code]tools.espf2232mm.server.build.openocddebugger=ftdi/tumpa.cfg[/code]

2) For more granular customisation you can Add and Amend a Debugger Launch.json as shown here.

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