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  
 
Page Index Toggle Pages: 1
Send Topic Print
Unable to start debugging. Unexpected GDB output (Read 2605 times)
HomerRamone
Junior Member
**
Offline



Posts: 38
Unable to start debugging. Unexpected GDB output
Feb 18th, 2022 at 8:10pm
 
My WRover ESP 32 arrived today so im trying to setup hardware debugging.
Ive installed the drivers with zidag on the first interface listed
Opened VS.
Set the options like so
ESP32 WROVER MODULE
COM7
Debug:Hardware
F2232H Dual RS232
No optimization

Clicked the "go" arrow which makes it build (As a side note - is it possible to have it not rebuild every time you click this if the code hasn't changed?)
Seems to build OK - last bit of output looks like:
Quote:
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 1536.0 kbit/s)...
Hash of data verified.
Leaving...
     The upload process has finished.

// MI Debugger Properties
Hard resetting via RTS pin...
{
  "serverLaunchTimeout": 5000,
  "filterStdout": false,
  "filterStderr": true,
  "targetArchitecture": "arm",
  "stopAtEntry": false,
  "externalConsole": false,
  "MIMode": "gdb",
  "MIDebuggerServerAddress": "localhost:3333",
  "cwd": "C:\\Users\\Homer\\AppData\\Local\\Temp\\VMBuilds\\PinLamp\\esp32_esp32wrover\\D
ebug",
  "MIDebuggerPath": "C:\\Users\\Homer\\AppData\\Local\\arduino15\\packages\\esp32\\tools\\xtensa-esp
32-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-espressif-esp32-10.0.1\\bin/openocd.exe
",
  "debugServerArgs": "-d2 -l \"{C:\\Users\\Homer\\AppData\\Local\\Temp\\VMBuilds\\PinLamp\\esp32_esp32wrover\
\Debug/PinLamp.ino_DebugOpenOCD.log}\" -s \"C:\\ProgramData\\vmicro\\tools\\openocd-espressif-esp32-10.0.1/share/openocd/s
cripts/\" -f \"C:\\ProgramData\\vmicro\\tools\\openocd-espressif-esp32-10.0.1/share/openocd/s
cripts/interface/ftdi/minimodule-lowcost.cfg\" -c \"set ESP32_RTOS none\" -f \"C:\\ProgramData\\vmicro\\tools\\openocd-espressif-esp32-10.0.1/share/openocd/s
cripts/board/esp32-wrover.cfg\" -c \"init; reset halt\"",
  "setupCommands": [],
  "program": "C:/Users/Homer/AppData/Local/Temp/VMBuilds/PinLamp/esp32_esp32wrover/Debug/PinL
amp.ino.elf",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false
  },
  "visualizerFile": "C:\\Users\\Homer\\AppData\\Local\\Temp\\VMBuilds\\PinLamp\\esp32_esp32wrover\\D
ebug\\debugger_tmp.natvis",
  "showDisplayString": true
}

Looks like its going to start then I get a dialog
Unable to start debugging. Unexpected GDB output from command -target-select remote localhost:3333. Remote communication error. Target disconnected.:  No Error.

Back to top
 

Please Register or Login to the Forum to see File Attachments
 
IP Logged
 
HomerRamone
Junior Member
**
Offline



Posts: 38
Re: Unable to start debugging. Unexpected GDB output
Reply #1 - Feb 18th, 2022 at 8:11pm
 
(Note I havent changed any of the jumpers on the board - its not clear if I need to add these 4 jumpers or not
Back to top
 
 
IP Logged
 
HomerRamone
Junior Member
**
Offline



Posts: 38
Re: Unable to start debugging. Unexpected GDB output
Reply #2 - Feb 21st, 2022 at 10:36am
 
Tried adding the 4 jumpers - I got a different error (dont have this to hand right now but it sounded like it was worse with the 4 jumpers)
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1570
Re: Unable to start debugging. Unexpected GDB output
Reply #3 - Feb 21st, 2022 at 10:48am
 
Thanks for the report.

The 4 jumpers will definitely be needed on the JTAG lines (TMS,TDO,TDI,TCK) to connect the chip to the onboard debug probe.
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/g...

Can you confirm if your board has a WROVER, or a WROVER-E chip fitted to it?

Is there a log file in the Build Folder from OpenOCD (shown below), and if so please attach it so we can review:
https://www.visualmicro.com/page/Troubleshooter-for-Debugging-an-Arduino-Sketch-...
Back to top
 
 
IP Logged
 
HomerRamone
Junior Member
**
Offline



Posts: 38
Re: Unable to start debugging. Unexpected GDB output
Reply #4 - Feb 21st, 2022 at 10:49am
 
Dont think there was a logfile there - but will double check that and the chip ID later today.
Thanks
Back to top
 
 
IP Logged
 
HomerRamone
Junior Member
**
Offline



Posts: 38
Re: Unable to start debugging. Unexpected GDB output
Reply #5 - Feb 21st, 2022 at 4:36pm
 
Not sure how I check the ID but heres a pic:
Will post a log directly.
Back to top
 

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



Posts: 1570
Re: Unable to start debugging. Unexpected GDB output
Reply #6 - Feb 21st, 2022 at 4:46pm
 
Thanks for the image, could you send one of the ESP chip itself? (it will have a marking on it of ESP32-WROVER, or ESP32-WROVER-E).

Hopefully the log will reveal further detail about the issue connecting.
Back to top
 
 
IP Logged
 
HomerRamone
Junior Member
**
Offline



Posts: 38
Re: Unable to start debugging. Unexpected GDB output
Reply #7 - Feb 21st, 2022 at 6:02pm
 
Says WSP-Rover-E
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1570
Re: Unable to start debugging. Unexpected GDB output
Reply #8 - Feb 21st, 2022 at 6:09pm
 
Thanks for the update.

If you ensure you are on the latest version of vMicro (22.02.18-0) available from the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Then if you add a Local Board.txt to the project (from vMicro > Add Code > Add Local Board.txt), and paste the below contents in:
Code:
debug.toolingsystem=gdbscript
# Most stable OpenOCD Version for newer ESP32 Boards
tools.openocd.debug.path={runtime.tools.openocd-esp32-0.10.1-2021.07.21.path}
 



Then save the file, and add a breakpoint to your sketch in loop.

Then select the ESP DEVKIT debgger, and use the Debug > Attach to process, this should be attach as expected.

Please also see the below notes about the behaivour of the ESP-WROVER-E chips with debugging at present.....

NOTE: This is currently behaving differently to our standard installations in the following ways:-
- You must set one breakpoint in your code before starting the debugging session.
- Breakpoints can only be added/changed when you are stopped on a breakpoint.

Back to top
 
 
IP Logged
 
HomerRamone
Junior Member
**
Offline



Posts: 38
Re: Unable to start debugging. Unexpected GDB output
Reply #9 - Feb 21st, 2022 at 7:50pm
 
ok, progress I think.
Debug options now as per image.
Local.txt file added as instructions

Debugger now starts and I can get it to break in the main .ino loop.
However, i'm struggling to get a breakpoint else where in the code. Doing so seems to frequently result in debugging stopping with the message:

Frame not in module
Quote:
The current stack frame was not found in a loaded module. Source cannot be shown for this location.
You can view the disassembly in the Disassembly window...


Callstack has only one entry:
Quote:
>      xthal_window_spill_nw() Line 234      C++


I can step into some of my files from the breakpoint in the .ino, but if I say try to "run to cursor" I get the frame error again.
I thought this might be the breakpoint limitation, but I tried disabling all breakpoints and doing a "step out" and got the same.
Additionally if I then try and start the debug process again then it eventually fails, the few lines in the output window read:
Quote:
Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0xffffff, SizeID=0xff), defaulting to 4MB
Compressed 8192 bytes to 47...
A fatal error occurred: Timed out waiting for packet content

The uploader returned an error

Power cycling the dev board seems to resolve this but this seems like a workaround rather than a solution.

I've looked for the logfile mentioned above, but the only one I could find is from 2 days ago. I moved this and rebuilt and still no log.
Back to top
 
 
IP Logged
 
HomerRamone
Junior Member
**
Offline



Posts: 38
Re: Unable to start debugging. Unexpected GDB output
Reply #10 - Feb 21st, 2022 at 8:22pm
 
Ok, think ive gotten to the bottom of this.

The issue it would seem was caused by a call to deserializeJsonDoc when optmizations were disabled.
The cause appears to be it not liking a large StaticJsonDocument. Switched to use DynamicJsonDocument and it no longer gives me the stack frame error.

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