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 Hardware debuging with ESP-PROG fails in VS2022 + VM (lib_usb error) (Read 1666 times)
emha69
Newbies
*
Offline


Posts: 9
Joined: Jul 21st, 2022
Hardware debuging with ESP-PROG fails in VS2022 + VM (lib_usb error)
Feb 7th, 2024 at 10:06am
Print Post  
I have a working setup in IDF5.1 with ESP-PROG which can upload and debug the code on ESP32. 

The COM+0 is using winusb driver and COM+1 standard VCOM driver for software flashing with esptool.

In VS2022 and visualmicro I am using Esptool for uploading and that works, but starting the openocd fails -- it cannot start gdb.

The output is

Starting:  -d2 -l N-VS.ino_DebugOpenOCD.log}" -s s/" -f s/interface/ftdi/minimodule-lowcost.cfg" -c "set ESP32_RTOS none" -f s/board/esp-wroom-32.cfg" -c "init; reset halt"
Starting: c\esp-2021r2-patch5-8.4.0/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"
exited with code 1 (0x1).

The VS2022 dialog shows "Unable to start debugging. GDB exited unexpectedly..."

The OpenOCD log shows following

none
adapter speed: 2000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
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 : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Listening on port 3333 for gdb connections
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 : Target halted. PRO_CPU: PC=0x4016CA9A (active)    APP_CPU: PC=0x4016CA9A 
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Warn : esp32: Failed writing 4 bytes at address 0x3ff48000, data - 00, 20, 49, 9c, 4c, 00, 00, 00
Error: xtensa_write_uint32_list: error writing to 3ff48000
Warn : esp32_soc_reset xtensa_write_uint32_list (reg_value_pairs_pre) err=-
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()


The same hardware and HW+SW setup works perfectly in VS with serial debugging.

It seems to me that VM does not start OpenOCD correctly. The config option in IDF is
-s ${openocd_path}/share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f target/esp32.cfg

Looking at output of VS, neither the board, and interface are configured correctly, although the vMicro settings
are correct.





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


Posts: 2728
Joined: Feb 13th, 2019
Re: Hardware debuging with ESP-PROG fails in VS2022 + VM (lib_usb error)
Reply #1 - Feb 7th, 2024 at 11:40am
Print Post  
Thanks for the report.

Can you attach the output requested at the top of the page so we can see the full configuration you are using?

You can test the suggested configuration by adding a local board.txt to the project (vMicro > Add Code > Add Local Board.txt) and putting the below entries in:
# IDF Configuration for Standard ESP32 Target with ESP-PROG / DEVKIT Board
tools.openocd.debug.openocdscript=../target/esp32.cfg
tools.esp32prog.vmserver.build.openocddebugger=ftdi/esp32_devkitj_v1.cfg
« Last Edit: Feb 7th, 2024 at 12:27pm by Simon@Visual Micro »  
Back to top
IP Logged
 
emha69
Newbies
*
Offline


Posts: 9
Joined: Jul 21st, 2022
Re: Hardware debuging with ESP-PROG fails in VS2022 + VM (lib_usb error)
Reply #2 - Feb 13th, 2024 at 9:37am
Print Post  
I followed your instructions. The problem still with opening LIBUSB where the libusb-WINUSB driver is attached (vid=0403, pid=6010).

This is the output of the OCD, screenshot of drivers and build logi is in attachment.

none separate
none
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : Configured 2 cores
esp32 interrupt mask on
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Error: An adapter speed is not selected in the init script. Insert a call to adapter_khz or jtag_rclk to proceed.

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

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


Posts: 2728
Joined: Feb 13th, 2019
Re: Hardware debuging with ESP-PROG fails in VS2022 + VM (lib_usb error)
Reply #3 - Feb 13th, 2024 at 10:59am
Print Post  
Thanks for the update, the LIBUSB error in the logs can be ignored, and believe the driver you have installed is correct.

Can you try replacing the board.txt entries with the attached, this includes the clock speed configuration.

  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
emha69
Newbies
*
Offline


Posts: 9
Joined: Jul 21st, 2022
Re: Hardware debuging with ESP-PROG fails in VS2022 + VM (lib_usb error)
Reply #4 - Feb 28th, 2024 at 11:42am
Print Post  
I did that and still does not work. Here is the debug log, which is same as previously:

none separate
adapter speed: 2000 kHz
none
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : Configured 2 cores
esp32 interrupt mask on
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
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 : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Listening on port 3333 for gdb connections
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 : Target halted. PRO_CPU: PC=0x400F1B06 (active)    APP_CPU: PC=0x400F1B06 
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Warn : esp32: Failed writing 4 bytes at address 0x3ff48000, data - 00, 20, 49, 9c, 4c, 00, 00, 00
Error: xtensa_write_uint32_list: error writing to 3ff48000
Warn : esp32_soc_reset xtensa_write_uint32_list (reg_value_pairs_pre) err=-4



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: 2728
Joined: Feb 13th, 2019
Re: Hardware debuging with ESP-PROG fails in VS2022 + VM (lib_usb error)
Reply #5 - Feb 28th, 2024 at 12:35pm
Print Post  
Thanks for the update.

Can you confirm your Blink Sketch is not using any of the GPIO pins 12 through 15, and you are not using any libraries e.g. SD?

I assume there is nothing else connected except the ESP-PROG to the ESP32 board?
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint