Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 

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 and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Pages: 1 2 
Send Topic Print
ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG (Read 2832 times)
Marco (Italy)
Full Member
***
Offline



Posts: 165
ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Jul 3rd, 2022 at 8: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
Back to top
 

Please Register or Login to the Forum to see File Attachments
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline



Posts: 165
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #1 - Jul 3rd, 2022 at 1: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?
Back to top
 

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



Posts: 11541
United Kingdom
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #2 - Jul 3rd, 2022 at 2:29pm
 
Thanks for the output. Please also switch on the "show build properties" mentioned above. Then the output will show your config. Thanks
Back to top
 

Tim Leek
home
WWW  
IP Logged
 
Marco (Italy)
Full Member
***
Offline



Posts: 165
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #3 - Jul 3rd, 2022 at 7: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.

Shocked
Back to top
 

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



Posts: 11541
United Kingdom
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #4 - Jul 3rd, 2022 at 8:07pm
 
Please uncheck "Upload using programmer".
Back to top
« Last Edit: Jul 3rd, 2022 at 8:08pm by Tim@Visual Micro »  

Tim Leek
home
WWW  
IP Logged
 
Marco (Italy)
Full Member
***
Offline



Posts: 165
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #5 - Jul 4th, 2022 at 5: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
Grin
Back to top
 

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



Posts: 1578
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #6 - Jul 4th, 2022 at 10: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
Back to top
 
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline



Posts: 165
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #7 - Jul 4th, 2022 at 4: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!
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1578
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #8 - Jul 4th, 2022 at 5: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.
Back to top
 
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline



Posts: 165
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #9 - Jul 4th, 2022 at 5: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
Smiley
best
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1578
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #10 - Jul 4th, 2022 at 6: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
Back to top
 
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline



Posts: 165
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #11 - Jul 5th, 2022 at 7: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




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



Posts: 1578
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #12 - Jul 5th, 2022 at 9: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)
Back to top
 
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline



Posts: 165
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #13 - Jul 5th, 2022 at 10: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.
Back to top
 

Please Register or Login to the Forum to see File Attachments
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline



Posts: 165
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #14 - Jul 5th, 2022 at 11: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)
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1578
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #15 - Jul 5th, 2022 at 11: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" 

Back to top
« Last Edit: Jul 5th, 2022 at 11:42am by Simon@Visual Micro »  
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline



Posts: 165
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #16 - Jul 5th, 2022 at 1: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/scrip
ts/" -f "C:/ProgramData/vmicro/tools/openocd-esp32-0.10.1-2021.07.21/share/openocd/scrip
ts/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!
Back to top
 
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline



Posts: 165
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #17 - Jul 5th, 2022 at 1: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!
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1578
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #18 - Jul 5th, 2022 at 1: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?
Back to top
 
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline



Posts: 165
Re: ESP32-C3-DevKitC-02 debug/upload issue with ESP-PROG
Reply #19 - Jul 5th, 2022 at 2:42pm
 
Hi Simon
using the zadi tool the situation is in attach pic.
Marco
Smiley
Back to top
 

Please Register or Login to the Forum to see File Attachments
 
IP Logged
 
Pages: 1 2 
Send Topic Print