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) ESP32 Debugging with JLink (Read 7484 times)
Sid Price
Junior Member
**
Offline


Posts: 54
Location: Tijeras
Joined: Jun 28th, 2021
Re: ESP32 Debugging with JLink
Reply #20 - Jan 24th, 2022 at 5:01pm
Print Post  
Well, I uninstalled and reinstalled VM and no change.

Then I looked in the folder for OpenOCD and saw the attached, this AFTER a reinstallation!
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: ESP32 Debugging with JLink
Reply #21 - Jan 24th, 2022 at 5:04pm
Print Post  
Thanks for the detail.

Re-installing VM itself doesn't replace all of the tools it adds at runtime.

If you delete the whole folder "C:\ProgramData\VMicro\tools\openocd-espressif-esp32-10.0.1"

Then try and start debugging in vMicro it will pull down the ZIP again from our website.

If this fails we can provide the download link for manual extraction on your PC.
  
Back to top
 
IP Logged
 
Sid Price
Junior Member
**
Offline


Posts: 54
Location: Tijeras
Joined: Jun 28th, 2021
Re: ESP32 Debugging with JLink
Reply #22 - Jan 24th, 2022 at 5:13pm
Print Post  
Now the debugger tries to start but fails to connect to GDB:

Code
Select All
Starting: "C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1\bin/openocd.exe" -d2 -l wroverkit\Debug/esp32_standalone_serial.ino_DebugOpenOCD.log}" -s s/" -f s/interface/jlink.cfg" -c "set ESP32_RTOS none" -f s/board/esp-wroom-32.cfg" -c "init; reset halt"
Starting: c\gcc8_4_0-esp-2021r2/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\gcc8_4_0-esp-2021r2/bin\xtensa-esp32-elf-gdb.exe" exited with code -1073741515 (0xC0000135).
 

  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: ESP32 Debugging with JLink
Reply #23 - Jan 24th, 2022 at 5:19pm
Print Post  
Perfect, could you attach the log file from:
Code
Select All
overkit\Debug/esp32_standalone_serial.ino_DebugOpenOCD.log 

  
Back to top
 
IP Logged
 
Sid Price
Junior Member
**
Offline


Posts: 54
Location: Tijeras
Joined: Jun 28th, 2021
Re: ESP32 Debugging with JLink
Reply #24 - Jan 24th, 2022 at 5:26pm
Print Post  
I just tried the command you posted earlier for OpenOCD, results:

Code
Select All

OpenOCD log file:

[code c++]none
adapter speed: 2000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Info : J-Link Ultra V5 compiled Dec 17 2021 08:51:15
Info : Hardware version: 5.00
Info : VTarget = 3.288 V
Info : clock speed 2000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
 



I am no longer seeing the fail to connect to GDB message, in fact the Debug view has once again disappeared. And the timestamp on the files is NOT the latest run attempt.
« Last Edit: Jan 24th, 2022 at 5:27pm by Sid Price »  
Back to top
 
IP Logged
 
Sid Price
Junior Member
**
Offline


Posts: 54
Location: Tijeras
Joined: Jun 28th, 2021
Re: ESP32 Debugging with JLink
Reply #25 - Jan 24th, 2022 at 5:30pm
Print Post  
OK, one more run and this is the content of OpenOCD log:

Code (C++)
Select All
none
adapter speed: 2000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Warn : Failed to open device: LIBUSB_ERROR_ACCESS.
Error: No J-Link device found.

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() 

  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: ESP32 Debugging with JLink
Reply #26 - Jan 24th, 2022 at 5:32pm
Print Post  
Brilliant, the previous log shows OpenOCD has connected OK and all drivers are still correct etc...

Did you close the command prompt before trying to begin the debug session in Visual Studio? (only one copy of OpenOCD.exe can run at a time for the same device)
« Last Edit: Jan 24th, 2022 at 5:32pm by Simon@Visual Micro »  
Back to top
 
IP Logged
 
Sid Price
Junior Member
**
Offline


Posts: 54
Location: Tijeras
Joined: Jun 28th, 2021
Re: ESP32 Debugging with JLink
Reply #27 - Jan 24th, 2022 at 5:46pm
Print Post  
Yes the Command Prompt is closed.

This is so unstable that I cannot get the same results twice. Once again, the OpenOCD log is not being updated. I have powered the board and JLink off/on, and restarted VS but the log is not getting updated, and the Debug window does not get created, meaning the debugger never starts.

I think we need to clean VM completely and reinstall.

I don't know how much longer I can continue with this; I have lost almost half-a-day of work this morning already, not counting previous failed sessions Sad
  
Back to top
 
IP Logged
 
enk
Newbies
*
Offline


Posts: 1
Joined: Jan 10th, 2024
Re: ESP32 Debugging with JLink
Reply #28 - Jan 11th, 2024 at 2:07am
Print Post  
It would be great to update the wiring diagramhttps://www.visualmicro.com/page/ESP32-Debugging.aspx. I too, per the diagram, left the VCC wire unattached and the debugger did not work. I spent a few hours trying many other ways to get the debugger working until I found this thread and re-attached the VCC wire. Once I did that, the debugger worked.

Simon@Visual Micro wrote on Jan 24th, 2022 at 9:39am:
Thanks for the report.

1) That is correct, and we will update the JLink wiring diagram below to show the solid line (currently dashed) for the VREF pin.  The Jlink can also supply power depending on the model, and this is what the note on the generic wiring diagram on the page was referring to, we will try and clarify that further as well.
https://www.visualmicro.com/pics/Debug-Help-ESP32-Jlink-Connections.png

3) Which board are you selecting in vMicro? There is a seperate OpenOCD Config for the Wrover modules, which is automatically selected when using the "ESP32 Wrover Module" from the board list (not the "ESP32 Wrover Kit (all versions)").  This can also be overridden when using a different board by adding the below config to a local board.txt in the project:
Code
Select All
tools.openocd.debug.openocdscript=esp32-wrover.cfg 




On a side note we have been working on an updated OpenOCD integration for the newer C and S modules, however this is not available at present due to issues in integration.

  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: ESP32 Debugging with JLink
Reply #29 - Jan 11th, 2024 at 9:15am
Print Post  
Thanks for the update, we will try and make it clearer that the main diagram shown is the generic JTAG configuration, and many probes supply voltage to the board from the VCC pin.

The JLink specific diagram shows the VCC pin as a solid line, as it needs to detect the voltage from the board for it to work correctly, though it does not provide power to the board:
https://www.visualmicro.com/pics/Debug-Help-ESP32-Jlink-Connections.png
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint