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
Hot Topic (More than 8 Replies) ESP32-DevkitS module support (Read 4359 times)
Dak
Newbies
*
Offline


Posts: 7
Joined: Nov 15th, 2021
ESP32-DevkitS module support
Nov 15th, 2021 at 11:43am
Print Post  
Hello,
please do you have some experience with ESP32-DevkitS module debug? I tried ESP32-Devkitc-V4 and it works well with ESP32-Prog debugger. But with ESP32-DevkitS module (I put inside ESP32-WROOM-32E 16MB submodule) I cant get debug working. There is no problem to flash DevkitS.
Thank you very much. David
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: ESP32-DevkitS module support
Reply #1 - Nov 15th, 2021 at 11:53am
Print Post  
Thanks for the report.

Are you flashing the board via the ESP-PROG module using a the Enable Programmer option?
  
Back to top
IP Logged
 
Dak
Newbies
*
Offline


Posts: 7
Joined: Nov 15th, 2021
Re: ESP32-DevkitS module support
Reply #2 - Nov 15th, 2021 at 12:50pm
Print Post  
Thanks very much for your prompt answer and sorry for my delay... I flash the board using COM connection directly to Devkitc or Devkits module. It works properly with both modules even there are different (4MB vs. 16MB) wroom submodules.
So I use No Programmer option on Visual Micro.
  
Back to top
 
IP Logged
 
Dak
Newbies
*
Offline


Posts: 7
Joined: Nov 15th, 2021
Re: ESP32-DevkitS module support
Reply #3 - Nov 15th, 2021 at 12:59pm
Print Post  
There is one more difference between submodules... On DevkitC there is version ESP-WROOM-32D and on DevkitS I put ESP-WROOM-32E (new one recommended for develepment). Maybe debugger dont communicate with 32E version? But I doubt about it...
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: ESP32-DevkitS module support
Reply #4 - Nov 15th, 2021 at 1:42pm
Print Post  
Thanks for the detail and update on the upload method and chip in use.

There is a new OpenOCD Release for the ESP32 platform which we can integrate in a future release.
https://github.com/espressif/openocd-esp32/releases/tag/v0.10.0-esp32-20211111

You can download and try this with the current version of Visual Micro, by adding a custom debugger_launch.json, adding current settings:
https://www.visualmicro.com/page/Debugging-Using-Custom-Hardware.aspx

Then altering the paths to point to the new OpenOCD Release on your machine.
  
Back to top
IP Logged
 
Dak
Newbies
*
Offline


Posts: 7
Joined: Nov 15th, 2021
Re: ESP32-DevkitS module support
Reply #5 - Nov 15th, 2021 at 2:46pm
Print Post  
Dear Simon, thank you so much for your effort. I tried new openOCD yesterday already, but it didnt help. Now I tried again, but there is some problem when openOCD tries to connect to DevkitS module...

New openOCD Log with DevkitS module:
Code
Select All
c:\ProgramData\VMicro\tools\openocd-esp32\bin>openocd -d2 -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"
Open On-Chip Debugger  v0.10.0-esp32-20211111 (2021-11-10-21:40)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

none
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : clock speed 2000 kHz
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
Warn : Bypassing JTAG setup events due to errors
Info : Listening on port 3333 for gdb connections
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
Warn : Bypassing JTAG setup events due to errors
Info : esp32: Debug controller was reset.
Info : esp32: Core was reset.
Error: Couldn't halt target before SoC reset
 



New openOCD Log with DevkitC-v4 module:
Code
Select All
c:\ProgramData\VMicro\tools\openocd-esp32\bin>openocd -d2 -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"
Open On-Chip Debugger  v0.10.0-esp32-20211111 (2021-11-10-21:40)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

none
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 was reset.
Info : esp32: Core was reset.
Info : esp32: Detected debug stubs @ 3ffc0820
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 : esp32: Target halted, PC=0x400E8972, debug_reason=00000000
Warn : Not full dbg stub table 1 of 2
Info : esp32: Debug controller was reset.
Info : esp32: Core was reset.
Info : esp32: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32: Core was reset.
Info : esp32: Target halted, PC=0x40000400, debug_reason=00000000
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : esp32: Debug controller was reset.
Info : esp32: Core was reset.
Info : esp32: Debug controller was reset.
Info : esp32: Core was reset.
Info : esp32: Detected debug stubs @ 3ffc0820
shutdown command invoked
Info : esp32: Restore debug stubs address 3ffc0820
 



I tried 2 pcs of ESP-Prog, OLIMEX ARM-USB-TINY-H debugger, second computer, cables change, but still there is this problem. It is interesting because DevkitS and DevkitC looks same. If DevkitS module will work properly there is chance to use 16MB Wroom module for developement.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: ESP32-DevkitS module support
Reply #6 - Nov 15th, 2021 at 3:18pm
Print Post  
Thanks for the detail.

The command is using the latest Openocd.exe, however the paths are using the old scripts provided in vMicro currently.

Does the below command change/improve the output? (run from c:\ProgramData\VMicro\tools\openocd-esp32\bin)
Code
Select All
openocd -d2 -s "c:\ProgramData\VMicro\tools\openocd-esp32\bin/share/openocd/scripts/" -f s/interface/ftdi/minimodule-lowcost.cfg" -c "set ESP32_RTOS none" -f -wrover-kit-3.3v.cfg" -c "init; reset halt" 

  
Back to top
IP Logged
 
Dak
Newbies
*
Offline


Posts: 7
Joined: Nov 15th, 2021
Re: ESP32-DevkitS module support
Reply #7 - Nov 15th, 2021 at 6:05pm
Print Post  
Dear Simon, thank you very much for your advice. It realy helped and the openOCD could be started in background same way as DevkitC module.
Unfortunately there are some new problems with gdb connection.
I tried to combine scripts from openOCD and Visual Micro, set the ESP32 Wrover Module as target but I wasnt successful.
I am getting the error:
Code
Select All
Warning:
Cannot insert breakpoint 2.
Cannot access memory at address 0x400d0cdb (ESP32 Wrover Module)
Cannot access memory at address 0x400d0bfe (ESP32 Dev Module) 


Please if possible, check this openOCD log:
Code
Select All
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 was reset.
Info : esp32: Core was reset.
Info : esp32: Detected debug stubs @ 3ffc0820
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 : esp32: Target halted, PC=0x400DFA3B, debug_reason=00000000
Warn : Not full dbg stub table 1 of 2
Info : esp32: Debug controller was reset.
Info : esp32: Core was reset.
Info : esp32: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32: Core was reset.
Info : esp32: Target halted, PC=0x40000400, debug_reason=00000000
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection on tcp/3333
Info : esp32: Target halted, PC=0x40092AEE, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 45 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 99 KB
Info : esp32: Target halted, PC=0x40092AEE, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.flash' size 16384 KB
Info : Using flash bank 'esp32.flash' size 16384 KB
Info : esp32: Target halted, PC=0x40092AEE, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 45 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 99 KB
Info : esp32: Target halted, PC=0x40092AEE, debug_reason=00000001
Info : Auto-detected flash bank 'irom' size 16384 KB
Info : Using flash bank 'irom' size 16384 KB
Info : esp32: Target halted, PC=0x40092AEE, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 45 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 99 KB
Info : esp32: Target halted, PC=0x40092AEE, debug_reason=00000001
Info : Auto-detected flash bank 'drom' size 16384 KB
Info : Using flash bank 'drom' size 16384 KB
Warn : negative reply, retrying
Warn : negative reply, retrying
Warn : acknowledgment received, but no packet pending
Warn : acknowledgment received, but no packet pending
Warn : address 0x400d0bfe not writable
Error: esp32: Failed to write breakpoint instruction (-4)!
Error: esp32: Failed to add SW breakpoint!
Error: can't add breakpoint: unknown reason
Info : dropped 'gdb' connection
 


Some attached logs could help too...
Sorry to take your time, but I hope DevkitS module with 16MB support can be very handy for developers.
Have a nice evening. BR David
  

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


Posts: 2441
Joined: Feb 13th, 2019
Re: ESP32-DevkitS module support
Reply #8 - Nov 15th, 2021 at 6:49pm
Print Post  
Thanks for the detail, I just wanted to confirm the latest version of openocd worked better via the command line.

We are only using one cfg file from the vMicro install: owcost.cfg

Is the posted output (not the attached log) from running OpenOCD and GDB via command line? Or from within Visual Studio?
  
Back to top
IP Logged
 
Dak
Newbies
*
Offline


Posts: 7
Joined: Nov 15th, 2021
Re: ESP32-DevkitS module support
Reply #9 - Nov 15th, 2021 at 7:13pm
Print Post  
The output is from Visual Studio DebugOpenOCD.log). Thank you very much for your new openOCD testing.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: ESP32-DevkitS module support
Reply #10 - Nov 15th, 2021 at 7:32pm
Print Post  
Thanks for confirming.

Have you added the Debugger_Launch.json to your project?  (vMicro > Add Code > Add Custom GDB Debugger (Advanced) )

If so the log from vMicro is showing the paths haven't been updated to your newest ESP32 OpenOCD folder (example attached, assuming the share/openocd/scripts/interface/ftdi/minimodule-lowcost.cfg has been copied over from the vMicro folder to the newest OpenOCD folder so all in one place)

« Last Edit: Nov 15th, 2021 at 7:35pm by Simon@Visual Micro »  

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


Posts: 7
Joined: Nov 15th, 2021
Re: ESP32-DevkitS module support
Reply #11 - Nov 16th, 2021 at 8:55am
Print Post  
Dear Simon, good morning and thank you so much for your support. It will be great to get 16MB ESP32 chips debug working. Yes I used custom json, tried to put the file everywhere, tried to change xml files, use second PC but finaly after few hours found the combobox with Manual/Custom option : ) Anyway it caused good step ahead, I hope the new error (same on both PC) could be fixed.
Code
Select All
Unable to start debugging: Failed to find thread 1 for break event 


Micro Build Log
Code
Select All
Launching custom debugger: son
Hard resetting via RTS pin...

// MI Debugger Properties
{
  "serverLaunchTimeout": 5000,
  "filterStdout": false,
  "filterStderr": true,
  "targetArchitecture": "arm",
  "stopAtEntry": false,
  "externalConsole": false,
  "MIMode": "gdb",
  "MIDebuggerServerAddress": "localhost:3333",
  "cwd": "C:\\Users\\dak\\AppData\\Local\\Temp\\VMBuilds\\Test002\\esp32_esp32\\Debug",
  "MIDebuggerPath": -elf-gcc\\1.22.0-97-gc752ad5-5.2.0/bin\\xtensa-esp32-elf-gdb.exe",
  "MIDebuggerArgs": "-ex \"set remote hardware-watchpoint-limit 2\" -ex \"mon reset halt\" -ex \"flushregs\" -ex \"thb app_main\" -ex \"c\"",
  "debugServerPath": "C:\\ProgramData\\VMicro\\tools\\openocd-esp32\\bin\\openocd.exe",
  "debugServerArgs": "-d2 -l est002.ino_DebugOpenOCD.log}\" -s \"c:\\ProgramData\\VMicro\\tools\\openocd-esp32/share/openocd/scripts/\" -f ftdi/minimodule-lowcost.cfg\" -c \"set ESP32_RTOS none\" -f 2-wrover-kit-3.3v.cfg\" -c \"init; reset halt\"",
  "setupCommands": [],
  "program": elf",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false
  },
  "visualizerFile": bugger_tmp.natvis",
  "showDisplayString": true
}
 


Debug Log
Code
Select All
openocd: Open On-Chip Debugger  v0.10.0-esp32-20211111 (2021-11-10-21:40)
openocd: Licensed under GNU GPL v2
openocd: For bug reports, read
openocd: 	http://openocd.org/doc/doxygen/bugs.html
openocd: debug_level: 2
openocd:
=thread-group-added,id="i1"
GNU gdb (crosstool-NG crosstool-ng-1.22.0-97-gc752ad5d) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-host_w64-mingw32 --target=xtensa-esp32-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="remote hardware-watchpoint-limit",value="2"
Register cache flushed.
Make hw breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
=cmd-param-changed,param="pagination",value="off"
0x40000400 in ?? ()
[New Thread 1073463852]
[New Thread 1073447000]
[New Thread 1073467960]
[New Thread 1073456088]
[New Thread 1073445228]
[New Thread 1073454676]
=thread-selected,id="1"
[New Thread 1073465264]
Program '' skončil s kódem 42 (0x2a). 


OpenOCD Log
Code
Select All
Warn : Interface already configured, ignoring
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 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.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Detected debug stubs @ 3ffc0820
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
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 : esp32.cpu0: Target halted, PC=0x400E8972, debug_reason=00000000
Info : Set GDB target to 'esp32.cpu0'
Info : esp32.cpu1: Target halted, PC=0x400E8972, debug_reason=00000000
Warn : Not full dbg stub table 1 of 2
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection on tcp/3333
Warn : No symbols for FreeRTOS!
Info : esp32.cpu0: Target halted, PC=0x40092AEE, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 45 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 99 KB
Info : esp32.cpu0: Target halted, PC=0x40092AEE, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu0.flash' size 16384 KB
Info : Using flash bank 'esp32.cpu0.flash' size 16384 KB
Info : esp32.cpu0: Target halted, PC=0x40092AEE, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 45 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 99 KB
Info : Using flash bank 'esp32.cpu0.irom' size 100 KB
Info : esp32.cpu0: Target halted, PC=0x40092AEE, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 45 KB
Info : Flash mapping 1: 0x20018 -> 0x400d0018, 99 KB
Info : Using flash bank 'esp32.cpu0.drom' size 48 KB
Info : New GDB Connection: 1, Target esp32.cpu0, state: halted 


SW Configuration:
Windows 10 Pro 20H2, build 19042.1348
VS Community 2022 17.0.0, .NET Framework 4.8.04084
Visual Micro 2021.1108.0, Arduino 1.8.16
Zadig 2.7 -> Dual RS232-HS libwdi 6.1.7600.16385
OpenOCD v0.10.0-esp32-20211111
Thank you again for your help & have a nice Tuesday.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: ESP32-DevkitS module support
Reply #12 - Nov 23rd, 2021 at 4:24pm
Print Post  
Thanks for the detail.

If you change the board.cfg file in use in the debugger_launch.JSON file from esp32-wrover-kit-3.3v.cfg to esp-wroom-32.cfg does this improve the situation?
(I have this working on a WeMos Lolin D32 with an ESP32-WROOM-32E 4MB chip in vMicro currently)

Do you have a WROOM-32D you can put into the DevKit-S board? (just in case there is something different about the connections, though all looks straight through from the docs)
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: ESP32-DevkitS module support
Reply #13 - Feb 1st, 2022 at 3:23pm
Print Post  
Just to update, it is worth trying the latest release (21.11.08-19) available at the top of the board below:
https://www.visualmicro.com/forums/YaBB.pl?board=vs_arduino_ext_releases

To try the latest debugging setup, you will also need to add a local board.txt to the project, with the below entries:
Code
Select All
debug.toolingsystem=gdbscript
tools.openocd.debug.path={runtime.tools.openocd-esp32-0.10.1-2021.11.11.path} 

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint