VS Arduino
Visual Micro >> Hardware Debugging (GDB, GDB WiFi, GDB Stub) >> ESP32 with ESP-PROG won't start debugging
https://www.visualmicro.com/forums/YaBB.pl?num=1589707503

Message started by DJ4000 on May 17th, 2020 at 9:25am

Title: ESP32 with ESP-PROG won't start debugging
Post by DJ4000 on May 17th, 2020 at 9:25am
Upon clicking on "Start Debugging" using VS2019 and VSMicro, I have a successful compilation and upload to the ESP32 board (Adafruit ESP32 Feather), however I don't receive any message related to the start of the debugger session.  I had to unzip openocd myself as it was missing and not log for openocd are produced.  I have followed all the instructions regarding the installation of the USB driver, the cabling looks correct, debug mode, no optimization and Serial->Hardware selected with the ESP-PROG.  Not sure how to take it from here?

I have attached the end of the output file with Compiler and Uploader in verbose.
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=VSMicro_Output.txt ( 5 KB | 18 Downloads )

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by Visual Micro on May 17th, 2020 at 10:41am
Thanks for the output but it is missing the build properties


Quote:
vMicro > Compiler > Show Build Properties and Verbose

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by DJ4000 on May 17th, 2020 at 11:20am
I have attached the entire output now.
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=VSMicro_Output_001.txt ( 194 KB | 23 Downloads )

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by Simon Hopkinson on May 17th, 2020 at 1:08pm
Thanks for the output.

If there is no log at this location (which from the above there isnt)

Code (]C:\Users\didie\AppData\Local\Temp\VMBuilds\ESP32_Garden_Hub\esp32_featheresp32\Debug/ESP32_Garden_Hub.ino_DebugOpenOCD.log[/code):


Please try running the below command in the command line:- (with board and debugger all connected as normal)
[code]C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1\bin/openocd.exe -d2 -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"


This should give more output as to what the problem is, please post this output or the log back when possible.

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by DJ4000 on May 17th, 2020 at 5:59pm
Clean the solution, delete VMBuilds and start debug again. Now I get a log file created (attached).  I got the message from vsmicro (attached).  Only the Esp32 board and the ESP-PROG are connected (attached).
C:\Users\didie\Pictures\SavedPictures\COMports.png
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=ESP32_Garden_Hub_ino_DebugOpenOCD.txt ( 0 KB | 26 Downloads )
Screenshots_003.png ( 4 KB | 17 Downloads )

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by Simon Hopkinson on May 18th, 2020 at 10:23am
Thanks for the logs and information.

In the logs it shows the below message which is normally seen when the USB Driver has not been updated:
[code]Error: unable to open ftdi device with vid 0403, pid 6010, description 'Dual RS232-HS', serial '*' at bus location '*'[/code]

Can you confirm you have used the Zadig tool to update the driver for this device on Interface 0?

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by DJ4000 on May 21st, 2020 at 8:25am
Hi, sorry for the delay.  Busy week at work  8-).
First, yes I did use Zadic to replace the driver. I have then switch the hardware from the Adafruit ESP32 to the Espressif DEvkitC and now the debugger is working just fine.
I have ordered another ESP-PROG, so I can try again with the Adafruit board without unplugging the one that works now.
In desperation, I also download and install PlatformIO last week, could that had an influence on vsmicro?
Thank you so much for your help.  I will keep you posted on the second attempt with the Adafruit board.

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by Simon Hopkinson on May 21st, 2020 at 1:56pm
Thanks for the update and glad it is all working.

I don't believe PlatformIO should have an effect on the drivers, and we require the updated driver due to the software we use to communicate with the debugger.

I would expect the Adafruit ESP32 Feather board to work as expected, and let us know if there are any issues (NOTE: the driver may need installing again for the Adafruit board)

We have also published a video for Troubleshooting Hardware Debugging which works through this issue along with others, and links to the Troubleshooter Guide as well.

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by DJ4000 on Jun 8th, 2020 at 8:04am
Hi again,
Seems that I am in trouble again.
1. Is it so that I should be able to upload the code to the esp32 as usual (using the usb) while connected to the ESP-PROG?
At the moment that do not seems to work.  I have the following message:
Uploading 'ESP32Interrupt' to 'ESP32 Dev Module' using 'COM5'
Uploader started for board ESP32 Dev Module
Upload method will be: bootloader
Uploading via Bootloader
C:\Users\didie\AppData\Local\arduino15\packages\esp32\tools\esptool_py\2.6.1\esptool.exe --chip esp32 --port "COM5" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 "C:\Users\didie\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.4/tools/partitions/boot_app0.bin" 0x1000 "C:\Users\didie\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.4/tools/sdk/bin/bootloader_dio_80m.bin" 0x10000 "C:\Users\didie\AppData\Local\Temp\VMBuilds\ESP32I~1\ESP32_~1\Debug/ESP32Interrupt.ino.bin" 0x8000 "C:\Users\didie\AppData\Local\Temp\VMBuilds\ESP32I~1\ESP32_~1\Debug/ESP32Interrupt.ino.partitions.bin"
esptool.py v2.6
Serial port COM5
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, Coding Scheme None
MAC: 24:0a:c4:09:b7:fc
Uploading stub...
esptool.py v2.6
Serial port COM5
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, Coding Scheme None
MAC: 24:0a:c4:09:b7:fc
Uploading stub...
Running stub...

The uploader returned an error
Running stub...
# Copy build result to 'Project>Property Pages>Intermediate Directory'
# Destination: file:///C:/Users/didie/Documents/Arduino/ESP32Interrupt/Debug/

Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0xffffff, SizeID=0xff), defaulting to 4MB
Compressed 8192 bytes to 47...
A fatal error occurred: Timed out waiting for packet content

2. If I use the attach process, the system timeout on listening to 3333.
adapter speed: 2000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
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)
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Listening on port 3333 for gdb connections
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection on tcp/3333
Info : Target halted. PRO_CPU: PC=0x40062299 (active)    APP_CPU: PC=0x00000000

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by Simon Hopkinson on Jun 8th, 2020 at 8:37am
I believe you should be able to upload via USB or via the programmer.  Have you tried disconnecting the Programmer from the PC when uploading via USB?

Can you enable the vMicro > Uploader > Verbose,. along with the options for verbose shown in the yellow box at the top, and re-try the uploads, and attach the logs?

#2 looks correct from what I can see there, but having all of the output will make it clearer.

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by DJ4000 on Jun 8th, 2020 at 9:08am
When I disconnect the ESP-PROG from the USB I can upload the code but obviously the debug session is not starting then.
Log attached.
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Verbose_log_002.txt ( 350 KB | 11 Downloads )

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by DJ4000 on Jun 8th, 2020 at 9:20am
Just an additional comment, I haven't connected VCC from the ESP-PROG to the ESP32 DevKit since the ESP32DevKit is already powered by the USB.

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by Simon Hopkinson on Jun 8th, 2020 at 9:39am
Thanks for the log and the additional note.  I would normally connect the VCC between the ESP-PROG and the ESP32, when using the Debugger / Programming uploader (and set the jumper to 3v3)

Could you try the upload via the programmer again, and attach the output? 

The USB Uploads can conflict with the programmer being attached, and there is an additional USB-Serial interface on the ESP-PROG, which can be connected to the Rx/Tx on the ESP to perform uploads, as well of course as using the JTAG upload via programmer.


Title: Re: ESP32 with ESP-PROG won't start debugging
Post by DJ4000 on Jun 8th, 2020 at 11:45am
I don't know how to do that to be honest.  Do you have a link with instructions I can follow to connect and start the upload via the programmer instead of the USB on the board?

Title: Re: ESP32 with ESP-PROG won't start debugging
Post by Simon Hopkinson on Jun 8th, 2020 at 12:45pm
To upload using the programmer (via JTAG), are the same connections as when you are debugging, along with changing the vMicro > Uploader > Hardware Programmer to the correct option, and then performing the upload again.
https://www.visualmicro.com/page/User-Guide.aspx?doc=Upload-and-Run.html

Uploading using the USB>Serial on the ESP-PROG is wired into the PROG interface on the board, and all pinouts for this programmer can be found in the documentation (below), but this is more often used when you have a target with no USB interface of its own.
https://github.com/espressif/esp-iot-solution/blob/master/documents/evaluation_boards/ESP-Prog_guide_en.md




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