Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
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....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
ESP32 debugging won't start (Read 372 times)
Robert B
Junior Member
**
Offline



Posts: 10
ESP32 debugging won't start
Mar 4th, 2020 at 7:18am
 
Using VS 2019 Community and VM 1.2020.0301 with Segger J-link.

After upload with debug , VM stops and return to VS.

Output log:

Uploading 'Sketch2' to 'ESP32 Dev Module' using 'Segger J-Link'
Open On-Chip Debugger  v0.10.0-esp32-20191114 (2019-11-14-14:19)
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
debug_level: 0
adapter speed: 3000 kHz
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
****[vMicro]**** Uploading App :Error: type 'esp32' is missing virt2phys
** Programming Started **
auto erase enabled
wrote 8192 bytes from file C:\Users\rbj\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.4/tools/p
artitions/boot_app0.bin in 3.288619s (2.433 KiB/s)
** Programming Finished **
****[vMicro]**** Uploading Bootloader :** Programming Started **
auto erase enabled
wrote 20480 bytes from file C:\Users\rbj\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.4/tools/s
dk/bin/bootloader_qio_40m.bin in 2.551492s (7.839 KiB/s)
** Programming Finished **
****[vMicro]**** Uploading Sketch :** Programming Started **
auto erase enabled
wrote 208896 bytes from file T:\TEMP\VMBuilds\Sketch2\esp32_esp32\Debug/Sketch2.ino.bin in 6.106277s (33.408 KiB/s)
** Programming Finished **
****[vMicro]**** Uploading Partitions :** Programming Started **
auto erase enabled
wrote 4096 bytes from file T:\TEMP\VMBuilds\Sketch2\esp32_esp32\Debug/Sketch2.ino.partitions.bin in 2.083649s (1.920 KiB/s)
** Programming Finished **
** Resetting Target **
shutdown command invoked
     The upload process has finished.

Back to top
 

 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 186
Re: ESP32 debugging won't start
Reply #1 - Mar 4th, 2020 at 10:27am
 
Thanks for the information, can you confirm which actions were run here (looks to be Build & Upload)?

To start the Hardware Debugger you can run "Debug > Attach to Process" if the code has been uploaded to the board already, and to perform the upload and start debugging all in one action the "Debug > Start" option will do both actions.
Back to top
 
 
IP Logged
 
Robert B
Junior Member
**
Offline



Posts: 10
Re: ESP32 debugging won't start
Reply #2 - Mar 4th, 2020 at 10:55am
 
I am using "Build&Upload" , when i try to "Debug > Attach to Process" i get a dialog from VS,
"Unable to start debugging, The value of miDebugerPath is invalid".
Program i starting , my led i blinking . Smiley

Back to top
« Last Edit: Mar 4th, 2020 at 10:56am by Robert B »  
 
IP Logged
 
Robert B
Junior Member
**
Offline



Posts: 10
Re: ESP32 debugging won't start
Reply #3 - Mar 4th, 2020 at 11:07am
 
OpenOCD.log
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 186
Re: ESP32 debugging won't start
Reply #4 - Mar 4th, 2020 at 11:08am
 
Thanks, I just wanted to be sure...

Could you enable the "vMicro > Upload > Verbose" option and then try the "Debug > Attach" again?

If you can attach the output from the Output "Micro Build" and "Debug" windows which will show what is happening more.

Also do you know what date/ and rough time you installed the current Visual Micro extension?
Back to top
 
 
IP Logged
 
Robert B
Junior Member
**
Offline



Posts: 10
Re: ESP32 debugging won't start
Reply #5 - Mar 4th, 2020 at 12:09pm
 
Upload verbose
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 186
Re: ESP32 debugging won't start
Reply #6 - Mar 4th, 2020 at 12:24pm
 
Thanks, could you try with the "Debug > Attach" event which is failing, and attach the output again from that?

(The paths look correct in this upload log, and the Verbose option changed affects the logging for Debug and Upload)
Back to top
 
 
IP Logged
 
Robert B
Junior Member
**
Offline



Posts: 10
Re: ESP32 debugging won't start
Reply #7 - Mar 4th, 2020 at 12:35pm
 
Compile and uploaded the program,
tried some times "Debug > Attach".
I get the same result with dialog.
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 186
Re: ESP32 debugging won't start
Reply #8 - Mar 4th, 2020 at 12:47pm
 
If you close the error dialog after Debug > Attach, then go to the Output Window, and set the option at the top of the window to "Show Output From: Debug" there should be some output similar to the below:
Code:
Starting: "C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1\bin/openocd.exe" -d2 -l "{C:\Users\Simon\AppData\Local\Temp\VMBuilds\ESP32WROOMSC_JLINK_BLINK_GDB\esp32_esp32\Debug/ESP32WROOMSC_JLINK_BLINK_GDB.ino_DebugOpenOCD.log}" -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/jlink.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"
Starting: "C:\Users\Simon\AppData\Local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.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"
"C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1\bin/openocd.exe" exited with code 1 (0x1). 



Again in the Output Window, "Show Output From: Micro Build" there should be some JSON output starting with "# MI Debugger Properties", which is also useful to help us see what is happening in the Debug > Attach event.
Back to top
 
 
IP Logged
 
Robert B
Junior Member
**
Offline



Posts: 10
Re: ESP32 debugging won't start
Reply #9 - Mar 4th, 2020 at 12:54pm
 
ERROR: Launch properties formatting error: Access to the path 'T:\TEMP\VMBuilds\Sketch2\esp32_esp32\Debug\debugger_tmp.natvis' is denied.

# MI Debugger Properties
{
  "serverLaunchTimeout": 5000,
  "filterStdout": false,
  "filterStderr": true,
  "targetArchitecture": "arm",
  "stopAtEntry": false,
  "externalConsole": false,
  "MIMode": "gdb",
  "MIDebuggerServerAddress": "localhost:3333",
  "cwd": "T:\\TEMP\\VMBuilds\\Sketch2\\esp32_esp32\\Debug",
  "MIDebuggerPath": "{runtime.tools.arm-none-eabi-gcc.path}/bin\\arm-none-eabi-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-0.10.0.20200213\\bin/openocd.exe",
  "debugServerArgs": "-d2 -l \"{T:\\TEMP\\VMBuilds\\Sketch2\\esp32_esp32\\Debug/Sketch2.ino_DebugOpenOCD.log}
\" -s \"C:\\ProgramData\\vmicro\\tools\\openocd-0.10.0.20200213/scripts/\" -f \"interface/jlink.cfg\"",
  "program": "T:/TEMP/VMBuilds/Sketch2/esp32_esp32/Debug/Sketch2.ino.elf",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false
  }
}
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 186
Re: ESP32 debugging won't start
Reply #10 - Mar 4th, 2020 at 1:03pm
 
Thanks, I am unsure about the permissions issue at the top, are you running VS as an Administrator?

The paths for the ESP32 Debugging are definitely wrong in the JSON output, there has been a minor update to resolve this.

To install you will need to manually uninstall Visual Micro from VS through the Extensions > Installed > Uninstall, and close VS to allow the uninstaller to kick in.

Then re-install it from the latest in the forum, and this should resolve the path issues you are experiencing for the debugger.
Back to top
 
 
IP Logged
 
Robert B
Junior Member
**
Offline



Posts: 10
Re: ESP32 debugging won't start
Reply #11 - Mar 4th, 2020 at 2:05pm
 
Started VS as Admin, same answer without "ERROR".

# MI Debugger Properties
{
  "serverLaunchTimeout": 5000,
  "filterStdout": false,
  "filterStderr": true,
  "targetArchitecture": "arm",
  "stopAtEntry": false,
  "externalConsole": false,
  "MIMode": "gdb",
  "MIDebuggerServerAddress": "localhost:3333",
  "cwd": "T:\\TEMP\\VMBuilds\\Sketch2\\esp32_esp32\\Debug",
  "MIDebuggerPath": "{runtime.tools.arm-none-eabi-gcc.path}/bin\\arm-none-eabi-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-0.10.0.20200213\\bin/openocd.exe",
  "debugServerArgs": "-d2 -l \"{T:\\TEMP\\VMBuilds\\Sketch2\\esp32_esp32\\Debug/Sketch2.ino_DebugOpenOCD.log}
\" -s \"C:\\ProgramData\\vmicro\\tools\\openocd-0.10.0.20200213/scripts/\" -f \"interface/jlink.cfg\"",
  "program": "T:/TEMP/VMBuilds/Sketch2/esp32_esp32/Debug/Sketch2.ino.elf",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false
  },
  "visualizerFile": "T:\\TEMP\\VMBuilds\\Sketch2\\esp32_esp32\\Debug\\debugger_tmp.natvis",
  "showDisplayString": true
}

Uninstall VM.

Install lastest VM.

Almost started Smiley i can see debug tabs, but stop with error :
"Unable to start debugging. Failed to find thread 1 for break event"


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"
0x400e812e in esp_pm_impl_waiti () at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/co
mponents/esp32/pm_esp32.c:492
[New Thread 1073463528]
[New Thread 1073447000]
[New Thread 1073467632]
[New Thread 1073455716]
[New Thread 1073445320]
[New Thread 1073446424]
=thread-selected,id="1"
[New Thread 1073464940]
The program '' has exited with code 42 (0x2a).







Back to top
« Last Edit: Mar 4th, 2020 at 2:06pm by Robert B »  
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 186
Re: ESP32 debugging won't start
Reply #12 - Mar 4th, 2020 at 2:07pm
 
Thanks for persisting, and Ill investigate further as sure we had resolved this, and update as soon as possible...
Back to top
 
 
IP Logged
 
Robert B
Junior Member
**
Offline



Posts: 10
Re: ESP32 debugging won't start
Reply #13 - Mar 4th, 2020 at 2:27pm
 
Thank you for your job,
waiting with great interest.
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 186
Re: ESP32 debugging won't start
Reply #14 - Mar 4th, 2020 at 2:37pm
 
I see from a re-install the updates in the package don't seem to apply properly if previously installed, we will publish a full new version soon with these updates so they definitely install.

In the meantime there are two ways around this:-

1) Change the IDE Selection to Arduino 1.9 (beta) and this will use alternate configurations which will still work (can be configured the same as 1.6/1.8 for IDE locations etc...).  This can be setup by going to IDE > Configure IDE Locations, and changing the drop down to Arduino 1.9, and setting the paths as needed. Then ensure it is selected in the vMicro > IDE drop down.

OR

2) If you go to vMicro > General > Global Options, and at the bottom there is a property "Assembly Location".  If you take the path from this and open it in windows explorer.  Then navigate from there to "Micro Platforms\arduino16x\hardware\esp32". Put the two attached files into that folder (replace the existing ones). Then just restart Visual Studio and re-select the debugger and programmer options, and try attaching again.




Back to top
 

esp32.zip (3 KB | )
 
IP Logged
 
Robert B
Junior Member
**
Offline



Posts: 10
Re: ESP32 debugging won't start
Reply #15 - Mar 5th, 2020 at 7:09am
 
in both cases I got the same error.

output :
...
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"
0x400e812e in esp_pm_impl_waiti () at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/co
mponents/esp32/pm_esp32.c:492
[New Thread 1073463528]
[New Thread 1073447000]
[New Thread 1073467632]
[New Thread 1073455716]
[New Thread 1073445320]
[New Thread 1073446424]
=thread-selected,id="1"
[New Thread 1073464940]
The program '' has exited with code 42 (0x2a).
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 186
Re: ESP32 debugging won't start
Reply #16 - Mar 5th, 2020 at 10:53am
 
Thanks for the additional information.

I have noticed the OpenOCD Version listed in your output is from (2019-11-14-14:19), but the one we download is from (2019-03-13-09:57), which is quite a difference... do you have IDF Tools installed on your machine?

Can you rename the folder "C:\ProgramData\VMicro\tools\openocd-espressif-esp32-10.0.1" (e.g. put an x at the start), and then try attaching the debugger again?  (This should trigger a fresh download of the tool to the same location)

Back to top
 
 
IP Logged
 
Robert B
Junior Member
**
Offline



Posts: 10
Re: ESP32 debugging won't start
Reply #17 - Mar 6th, 2020 at 9:10am
 
Now it works.

Rename folder, VM download lasted version and debugging starts.  Smiley

Thanks for all yours effort.

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