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) Unable to start debugging. Unexpected GDB output (Read 4947 times)
HomerRamone
Junior Member
**
Offline


Posts: 38
Joined: Feb 5th, 2022
Unable to start debugging. Unexpected GDB output
Feb 18th, 2022 at 8:10pm
Print Post  
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": ebug",
  "MIDebuggerPath": 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": ",
  "debugServerArgs": "-d2 -l \Debug/PinLamp.ino_DebugOpenOCD.log}\" -s cripts/\" -f cripts/interface/ftdi/minimodule-lowcost.cfg\" -c \"set ESP32_RTOS none\" -f cripts/board/esp32-wrover.cfg\" -c \"init; reset halt\"",
  "setupCommands": [],
  "program": amp.ino.elf",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false
  },
  "visualizerFile": 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.

  

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


Posts: 38
Joined: Feb 5th, 2022
Re: Unable to start debugging. Unexpected GDB output
Reply #1 - Feb 18th, 2022 at 8:11pm
Print Post  
(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
Joined: Feb 5th, 2022
Re: Unable to start debugging. Unexpected GDB output
Reply #2 - Feb 21st, 2022 at 10:36am
Print Post  
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
*****
Online


Posts: 2143
Joined: Feb 13th, 2019
Re: Unable to start debugging. Unexpected GDB output
Reply #3 - Feb 21st, 2022 at 10:48am
Print Post  
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
Joined: Feb 5th, 2022
Re: Unable to start debugging. Unexpected GDB output
Reply #4 - Feb 21st, 2022 at 10:49am
Print Post  
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
Joined: Feb 5th, 2022
Re: Unable to start debugging. Unexpected GDB output
Reply #5 - Feb 21st, 2022 at 4:36pm
Print Post  
Not sure how I check the ID but heres a pic:
Will post a log directly.
  

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


Posts: 2143
Joined: Feb 13th, 2019
Re: Unable to start debugging. Unexpected GDB output
Reply #6 - Feb 21st, 2022 at 4:46pm
Print Post  
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
Joined: Feb 5th, 2022
Re: Unable to start debugging. Unexpected GDB output
Reply #7 - Feb 21st, 2022 at 6:02pm
Print Post  
Says WSP-Rover-E
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Online


Posts: 2143
Joined: Feb 13th, 2019
Re: Unable to start debugging. Unexpected GDB output
Reply #8 - Feb 21st, 2022 at 6:09pm
Print Post  
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
Select All
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
Joined: Feb 5th, 2022
Re: Unable to start debugging. Unexpected GDB output
Reply #9 - Feb 21st, 2022 at 7:50pm
Print Post  
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
Joined: Feb 5th, 2022
Re: Unable to start debugging. Unexpected GDB output
Reply #10 - Feb 21st, 2022 at 8:22pm
Print Post  
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 TopicPrint