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 Send TopicPrint
Normal Topic Debug ESP32 using SEGGER j-link (Read 3408 times)
1simone0
Newbies
*
Offline


Posts: 3
Joined: Mar 31st, 2021
Debug ESP32 using SEGGER j-link
May 24th, 2021 at 6:49pm
Print Post  
Hi, I'm trying to HW debug my ESP32 using a SEGGER j-link but without lucky. 

board: ESP32 DEV Module
Debugger: SEGGER j-link Base

Thi is what I did:

  • I downloaded Zadig and installed WinUSB (v6.1.7600.16385) driver instead the original SEGGER driver

  • Settings: 
    Debug: Hardware
    Selected SEGGER j-link as debugger
    Tried both "no optimizazion" and "no project optimizazion"

  • After that I build the solution and upload correctly via Serial

  • Debug-Attach to process and I get the attached error  Embarrassed


Also tried to upload the code using the programmer:
  • Selected Segger j-linnk as programmer and enabled Programmer.

  • When I try to upload the code I get this in the Micro Build Output:

Uploading 'prova_debug' to 'WiFi module' using 'Segger J-Link'
Open On-Chip Debugger  v0.10.0-esp32-20190313 (2019-03-13-09:57)
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
debug_level: 0
adapter speed: 2000 kHz
esp32 interrupt mask on
****[vMicro]**** Uploading App :Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Error during upload using programmer
The uploader process failed

The uploader process failed
The uploader returned an error


Any suggestion?
I also saw a guide on youtube "Advanced GDB Configuration Using JLink Drivers and Software" ehre theymake it work with the original Driver but it seems to be more complex. Could it solve my problem?
What's the difference between standard VM procedure and this "advanced" procedure?

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


Posts: 2425
Joined: Feb 13th, 2019
Re: Debug ESP32 using SEGGER j-link
Reply #1 - May 24th, 2021 at 8:26pm
Print Post  
Thanks for the report.

The error is most often related to a wiring issue, as the driver error should occur before this if shown.

Can you confirm from a hardware perspective:
1) You have all connections made to the J-Link?
https://www.visualmicro.com/pics/Debug-Help-ESP32-Jlink-Connections.png
2) The ESP board is powered from the USB?
3) The GND lines connected between ESP32 and J-Link?

The J-Link Software will verify the Debugger is connected, but I don't believe it understands the ESP32 so cannot validate this setup any further.

There are further steps we can take to look into this further, but checking all wiring and power is often the best first step in this scenario.
  
Back to top
IP Logged
 
1simone0
Newbies
*
Offline


Posts: 3
Joined: Mar 31st, 2021
Re: Debug ESP32 using SEGGER j-link
Reply #2 - May 24th, 2021 at 11:25pm
Print Post  
Hi Simon, thank you for the fast reply.

1) YES, All connection double checked, I also replaced all the cables.
2) YES, ESP32 is powered from USB
3) YES, GND lines are connected
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2425
Joined: Feb 13th, 2019
Re: Debug ESP32 using SEGGER j-link
Reply #3 - May 25th, 2021 at 8:43am
Print Post  
Thanks for the update.

Can you confirm which JLink Probe you have?  (The JLink Probes are often Isolated, so the VCC from 3V3 on the ESP32 will also need connecting to the 3V3 on the JLink)

Also ensure you aren't using any of the GPIO Pins in your sketch used for debugging (12,13,14,15).

Would it be possible to attach the full build log with the Verbose and Show Build Properties enabled (as shown at the top of this page), just so we understand the environment fully.

If you can also attach the Log in the Build Folder  <<SketchName>>.ino_DebugOpenOCD.log, which may reveal further information about the connection failure as well.
« Last Edit: May 25th, 2021 at 10:09am by Simon@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint