VS Arduino
Visual Micro >> Hardware Debugging (GDB, GDB WiFi, GDB Stub) >> ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
https://www.visualmicro.com/forums/YaBB.pl?num=1656833487

Message started by Marco (Italy) on Jul 3rd, 2022 at 7:31am

Title: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 3rd, 2022 at 7:31am
Hi Simon
this is the first time try to develop sw using ESP32. I followed your tutorial but there is mode to upload and debug my sketch.
hardware connection
ESP32-C3DEVKIT      ESP-prog
TMS  ----------------  TMS
TDI   ----------------  TDI
TDO  ----------------  TDO
TCK  ----------------   TCK
GND ----------------   GND
3V3 -----------------   3V3 (the ESP32 is not powered on his USB)

The verbose output is in attach.
best
Marco
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=ESP32_verbose.txt ( 26 KB | 0 Downloads )

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 3rd, 2022 at 12:00pm
Hi!
update on issue

Now I have installed ESP32C3 board 2.0 on Arduino IDE. Using the Arduino IDE via serial I can compile and upload on ESP32C3. On Visual Studio, now I can see and selected the right board ESP32C3, but there is a problem on compiling. The verbose output is in attach

can you help me?

https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=ESP32_verbose_001.txt ( 42 KB | 3 Downloads )

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Tim@Visual Micro on Jul 3rd, 2022 at 1:29pm
Thanks for the output. Please also switch on the "show build properties" mentioned above. Then the output will show your config. Thanks

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 3rd, 2022 at 6:03pm
Hi he the file verbose output with show build properties

there are two strange things:
1. the error has changed there is no longer a compilation error
2. the ESP32 card disappears from the list and yet it is perfectly installed. In fact, it is always available in the standard Arduino IDE. Then, after a while, it magically reappears in the list.

:o
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=ESP32_verbose_002.txt ( 152 KB | 1 Download )

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Tim@Visual Micro on Jul 3rd, 2022 at 7:07pm
Please uncheck "Upload using programmer".

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 4th, 2022 at 4:34am
Hi!
My HW debugger is connected and is ESP-PROG (JTAG)

the VM is set with:
uploader:  F2232dualRS232
debugger: hardware, F2232dualRS232, no optimization

the verbose output file is in attach
;D
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Output-MicroBuild_025.txt ( 186 KB | 2 Downloads )

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Simon@Visual Micro on Jul 4th, 2022 at 9:46am
Thanks for the detail.

To use the ESP32-C3 with the JTAG pins for debugging, a few things need to be configured:
Documentation: https://www.visualmicro.com/page/ESP32C3-JTAG-Debugging.aspx

1) Update the board package to v2.0.3 to avoid issues with the GDB.exe packaged into it.
2) Change the fuse bits to allow the JTAG pins to be used either by bootstrapping a pin, or permanently disable the USB-JTAG adapter.
3) Add the local board.txt entries to use the later version of OpenOCD which contains the configuration for the ESP32-C3.

The Upload using programmer option does not function correctly at present and always results in a reboot loop, so this should be set back to "No Programmer (default)", and the standard serial upload should be used, as in the Arduino IDE.

If your board is one of the Dev boards it may be worth reviewing the USB-JTAG adapter built into it, which doesn't require the ESP-PROG (but still has the same limitation on uploads via Serial):
Documentation: https://www.visualmicro.com/page/ESP32C3-USB-Debugging.aspx
Video Guide: https://www.youtube.com/watch?v=A59frxEvs7M

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 4th, 2022 at 3:22pm
Hi Simon!
a little update.
1) Now my board is ESP32 2.0.3
2) Using  VM now I can compile and upload the software via Serial UPLOADER without any error

Now, the problem for me is to get to debugging, possibly with JTAG. Using the fuse analysis tool on ESP32, I saw that the JTAG fuse is not blown. Now, the problem for me is that if I burn the fuse, I run the risk of losing the only way I have now to load the software, which is via Serial. In summary, in order to get a complete tool chain I need to enable uploading and debugging via JTAG.  Next step ?

... nice your web debugger, cool idea!

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Simon@Visual Micro on Jul 4th, 2022 at 4:24pm
Thanks for the update.

Burning the JTAG_SEL_ENABLE fuse will allow you to select the JTAG pins by pulling GPIO10 LOW during boot (if you have GPIO10 on your board of course).
Burning the DIS_USB_JTAG fuse will permanently disable USB-JTAG.

Neither of these will affect the Serial upload to our knowledge, they just affect whether the USB-JTAG is available (we have burned the DIS_USB_JTAG fuse on our ESP-C3-01M module and that still allows Serial upload to function correctly).

The USB-JTAG approach avoids having to alter any fuse bits, depending on the board you have, and only requires a USB lead and a few connections.

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 4th, 2022 at 4:56pm
Hi Simon
thanks for your pertinent comments. what do you mean about JTAG-USB? Because I'm using a ESP-PROG , is there another JTAG different connection, if yes is this supported by VM
:)
best

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Simon@Visual Micro on Jul 4th, 2022 at 5:01pm
The USB-JTAG is in-built on the ESP-32 Dev boards, and to my knowledge on all ESP32-C3 modules which have GPIO 18 and 19 available.  Using this initially avoids having to burn the fuses, and of course leaves all options open for the future.

This means you do not need the ESP-PROG at all, and just need a USB lead where you can access the VCC/GND/Data+/Data- Lines (whether by rewiring or if you have a breakout which fits on the end).

It is supported in Visual Micro, with the documentation and a walkthrough video of this working below:
Documentation: https://www.visualmicro.com/page/ESP32C3-USB-Debugging.aspx
Video Guide: https://www.youtube.com/watch?v=A59frxEvs7M

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 5th, 2022 at 6:50am
Hi Simon,
thanks for your steps!
Now my configuration is:
PIO18 connected to green wire usb
PIO19 connected to white wire  usb
5V to red wire usb (red LED is ON)
GND to black usb

Now, the ZADIG utility doesn't show me the USB- JTAGserial option driver in menu and VM doesn't recognize the ESP32C3.

my ZADIP setting are:
options>list alla devices >

can you help me?
best





Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Simon@Visual Micro on Jul 5th, 2022 at 8:39am
Can you confirm if swapping the wires on pins 18 and 19 changes whether it shows up in Zadig?

Have you changed any fuses at this point?  (DIS_USB_JTAG should still be False)

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 5th, 2022 at 9:35am
Hi Simon
we are near to solved my ESP32 issue!
USB driver is installed, was swapping pins problem.
Now I can upload, but the debug do not start.
In attach the output file.

https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Output-Debug.txt ( 1 KB | 2 Downloads )

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 5th, 2022 at 10:06am
to complete your questions:

Usb Config fuses:
DIS_USB_JTAG (BLOCK0)                              Disables USB JTAG. JTAG access via pads is control = False R/W (0b0)

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Simon@Visual Micro on Jul 5th, 2022 at 10:42am
Thanks for the detail.

If you ensure there are no instances of OpenOCD.exe running in Task Manager, then try running the command below and attach the output it should reveal more about the issue:
[code]"C:/ProgramData/vmicro/tools/openocd-esp32-0.10.1-2021.07.21/bin/openocd.exe" -d2 -c "adapter_khz 5000" -s "C:/ProgramData/vmicro/tools/openocd-esp32-0.10.1-2021.07.21/share/openocd/scripts/" -f "C:/ProgramData/vmicro/tools/openocd-esp32-0.10.1-2021.07.21/share/openocd/scripts/interface/../board/esp32c3-builtin.cfg" -c "set ESP32_RTOS none" -c "init; reset halt"[/code]

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 5th, 2022 at 12:00pm
Hi Simon

C:\Users\marco>"C:/ProgramData/vmicro/tools/openocd-esp32-0.10.1-2021.07.21/bin/openocd.exe" -d2 -c "adapter_khz 5000" -s "C:/ProgramData/vmicro/tools/openocd-esp32-0.10.1-2021.07.21/share/openocd/scripts/" -f "C:/ProgramData/vmicro/tools/openocd-esp32-0.10.1-2021.07.21/share/openocd/scripts/interface/../board/esp32c3-builtin.cfg" -c "set ESP32_RTOS none" -c "init; reset halt"
Open On-Chip Debugger  v0.10.0-esp32-20210721 (2021-07-21-13:35)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

adapter speed: 5000 kHz

Info : only one transport option; autoselect 'jtag'
Warn : Transport "jtag" was already selected
none
Error: libusb_open() failed with LIBUSB_ERROR_NOT_FOUND
Error: esp_usb_jtag: could not find or open device!

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 5th, 2022 at 12:02pm
Open On-Chip Debugger  v0.10.0-esp32-20210721 (2021-07-21-13:35)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

adapter speed: 5000 kHz

Info : only one transport option; autoselect 'jtag'
Warn : Transport "jtag" was already selected
none
Error: libusb_open() failed with LIBUSB_ERROR_NOT_FOUND
Error: esp_usb_jtag: could not find or open device!

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Simon@Visual Micro on Jul 5th, 2022 at 12:35pm
The "Error: esp_usb_jtag: could not find or open device!" seems to suggest it cannot see the board.

Just to check:-
Do you have the WinUSB driver installed for Interface 2 of the USB JTAG/serial debug unit?
Is the modified USB lead (connected to GPIO18+19 and VCC+GND) connected to your PC?

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 5th, 2022 at 1:42pm
Hi Simon
using the zadi tool the situation is in attach pic.
Marco
:)
usb.png ( 29 KB | 1 Download )

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Marco (Italy) on Jul 7th, 2022 at 12:27pm
For the moment I can't go into ESP32C3 use, I have no choice but to stop the test sessions, I'm just endlessly repeating what I've already done. I thank Simon for his availability. I look forward to further updates.
:o :-/

Title: Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Post by Simon@Visual Micro on Jul 7th, 2022 at 3:10pm
We are not sure why the USB Debugging did not work on your machine (Correct board, wiring, driver, OpenOCD Version, board.txt entries etc..), but for some reason it could never connect to your board.  Running the OpenOCD command directly in cmd always resulted in the error "Error: esp_usb_jtag: could not find or open device!".  It may be worth trying on another PC if you have one?

When we then moved to trying the JTAG debugging approach using the ESP-PROG, you burned the SOFT_DIS_JTAG fuse instead of either JTAG_SEL_ENABLE (which wasn't available), or the DIS_USB_JTAG (which is available) as we documented.  We have amended the image showing the fuse summary on this page in case this confused things, the instructional text remains the same.

As discussed we have not tried the SOFT_DIS_JTAG fuse, and the Espressif documentation seems to suggest the 256-bit HMAC secret key needs to be burned before the SOFT_DIS_JTAG fuse to then use the software to re-enable JTAG.

The choice of debugging options coupled with the delicate and potentially permanent fuse burning process for the ESP32C3 can make it difficult to get up and running, hence suggesting the USB route initially. This is all implemented by Espressif and we are just the glue between the components supplied by them.

Thank you for the detail and patience working through this with us, and let us know if you have any luck with the USB debugging on a different machine, however the SOFT_DIS_JTAG fuse may have also affected that on the board(s) with the fuse burned.

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