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] 2  Send TopicPrint
Hot Topic (More than 8 Replies) Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ... (Read 6341 times)
colinm
Junior Member
**
Offline


Posts: 13
Joined: Nov 28th, 2022
Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Nov 30th, 2022 at 2:10pm
Print Post  
I have just installed your software and don't seem to be able to get ScanNetwork example to start the debugger. Watched both of your videos but can't see where I am going wrong.
I am using Arduino 1.8.19 Earle Philhower 2.6.4 Visual studio community 2022 version 17.4.2
I have sent my build properties via email
« Last Edit: Nov 30th, 2022 at 2:11pm by colinm »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #1 - Nov 30th, 2022 at 4:38pm
Print Post  
Thanks for the report.

Can you confirm how you are trying to launch the debug session, is it from Debug > Start, or Debug > Attach to Process after performing the Build & Upload?
  
Back to top
 
IP Logged
 
colinm
Junior Member
**
Offline


Posts: 13
Joined: Nov 28th, 2022
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #2 - Nov 30th, 2022 at 4:47pm
Print Post  
I am using Debug>Start

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


Posts: 2145
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #3 - Nov 30th, 2022 at 4:56pm
Print Post  
Can you try running the Debug > Attach to Process, and let us know if this tries to start the debugging session? (a progress bar should show with "Initializing Debugger", and switch to the Output > Debug window with further detail).

If any output is shown in the Debug > Output window can you send that to us?
  
Back to top
 
IP Logged
 
colinm
Junior Member
**
Offline


Posts: 13
Joined: Nov 28th, 2022
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #4 - Nov 30th, 2022 at 5:28pm
Print Post  
No I get the message" unable to start debugging. Unexpected GDB output from command "-exec -run" Don't know how to run.

  
Back to top
 
IP Logged
 
colinm
Junior Member
**
Offline


Posts: 13
Joined: Nov 28th, 2022
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #5 - Nov 30th, 2022 at 5:31pm
Print Post  
output >debug has the following text 

=thread-group-added,id="i1"
GNU gdb (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 8.3.0.20190709-git
Copyright (C) 2019 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-w64-mingw32 --target=arm-none-eabi".
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="pagination",value="off"
Warning: Exceptions are not supported in this scenario.
The program '' has exited with code 42 (0x2a).

« Last Edit: Nov 30th, 2022 at 5:32pm by colinm »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #6 - Nov 30th, 2022 at 5:41pm
Print Post  
Thanks for the update,

If you enable the vMicro > Uploader > Verbose option, and then try resetting the target board, and then run the Debug > Attach to Process.

If this works then we may be missing something on the reset element, and if it fails, can you send us the additional JSON output in the Output > Micro Build window?
  
Back to top
 
IP Logged
 
colinm
Junior Member
**
Offline


Posts: 13
Joined: Nov 28th, 2022
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #7 - Nov 30th, 2022 at 7:39pm
Print Post  
thanks for the update

I tried resetting the target and debug>atach to process
it failed i have emailed the json file


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


Posts: 2145
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #8 - Dec 1st, 2022 at 11:09am
Print Post  
Thanks for the update and the JSON, the issue is some parameters are not being merged in the JSON which is why it isn't working currently, and it seems the wrong GDB.exe has been populated as well.

Check OpenOCD Tools are Available
Please ensure you have the OpenOCD Tools in:
Code
Select All
C:\ProgramData\VMicro\tools\openocd-rpi-0.10.0.20210623 



If the OpenOCD tools are not present, they can be downloaded from the below link, and extracted to C:\ProgramData\VMicro\tools
https://www.visualmicro.com/downloads/tools/openocd-rpi-0.10.0.20210623/openocd-...

To workaround the issue in the interim while we fix this one of the below options should work for you:
Option 1: Board.txt Overrides
1) Right click you rproject, and then go to "Add" > "Add Local board.txt"
2) Put the below in the file:
Code
Select All
params.verbose=-d2
path=C:\ProgramData\VMicro\tools\openocd-rpi-0.10.0.20210623
openocdscript=target/rp2040.cfg
initCmd=-c "init" 


3) Save the file, and try to use Debug > Attach to Process again to run the debugger.

Option 2: Full Custom JSON
1) Right click your project, and then go to "Add" > "Add Custom GDB Debugger (Advanced)" it will create a file in your project "RASPBERRY_PI_PICO_W.Debug.debugger_launch.json".
2) Then replace the contents of the file with the attached file
3) Now select vMicro > Debugger > Manual/Custom
4) Then try using Debug > Attach to Process again, it should now launch as expected

We will update when there is a fixed version available to resolve this fully.
« Last Edit: Dec 1st, 2022 at 11:28am by Simon@Visual Micro »  

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


Posts: 13
Joined: Nov 28th, 2022
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #9 - Dec 1st, 2022 at 11:38am
Print Post  
thanks for the update I have tried your last suggestions.
1 to 3 no problem
4 failed to run checked the OpenOCD files were missing and so I downloaded them as instructed.

now when I attach to process the work surface changes to a different layout but I still get and error message

"unable to start debugging. Unexpected GDB output from command -exec-run. Don't know how to run"

output>debug has the following

=thread-group-added,id="i1"
GNU gdb (GDB) 8.2.50.20190202-git
Copyright (C) 2019 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-w64-mingw32 --target=arm-none-eabi".
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="pagination",value="off"
Warning: Exceptions are not supported in this scenario.
The program '' has exited with code 42 (0x2a).


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


Posts: 2145
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #10 - Dec 1st, 2022 at 11:42am
Print Post  
Thanks for the update.

Can you send us the JSON output at the end of the Micro Build again so we can check everything has applied correctly?

Please also send the "*_DebugOpenOCD.log" log file in your Build Folder if it is present (e.g. ebug\ScanNetworks.ino_DebugOpenOCD.log)

  
Back to top
 
IP Logged
 
colinm
Junior Member
**
Offline


Posts: 13
Joined: Nov 28th, 2022
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #11 - Dec 1st, 2022 at 11:50am
Print Post  
As requested

Using project build property overrides from I:\Documents\Arduino\My Examples\ScanNetworks\board.txt
Launching custom debugger: file:///I:\Documents\Arduino\My Examples\ScanNetworks\RASPBERRY_PI_PICO_W.Debug.debugger_launch.json
 
// MI Debugger Properties
{
  "serverLaunchTimeout": 5000,
  "filterStdout": false,
  "filterStderr": true,
  "targetArchitecture": "arm",
  "stopAtEntry": false,
  "externalConsole": false,
  "MIMode": "gdb",
  "MIDebuggerServerAddress": "",
  "cwd": coprobe\\Debug",
  "MIDebuggerPath": 4.0-c-0196c06\\bin\\arm-none-eabi-gdb.exe",
  "MIDebuggerArgs": "",
  "debugServerPath": "",
  "debugServerArgs": "-d2 -l picoprobe\\Debug/ScanNetworks.ino_DebugOpenOCD.log}\" -s \"C:\\ProgramData\\VMicro\\tools\\openocd-rpi-0.10.0.20210623/scripts/\" -f picoprobe.cfg\" -f rget/rp2040.cfg\" -c \"init\"",
  "setupCommands": [],
  "program": Debug/ScanNetworks.ino.elf",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false
  },
  "visualizerFile": coprobe\\Debug\\debugger_tmp.natvis",
  "showDisplayString": true
}

sorry no "*_DebugOpenOCD.log" log file


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


Posts: 2145
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #12 - Dec 1st, 2022 at 12:19pm
Print Post  
Thanks for the detail, I had missed something in the JSON, can you replace the debugServerPath with the below line in the JSON, then save and try again:
Code
Select All
"debugServerPath": "C:\\ProgramData\\VMicro\\tools\\openocd-rpi-0.10.0.20210623\\bin/openocd.exe", 

  
Back to top
 
IP Logged
 
colinm
Junior Member
**
Offline


Posts: 13
Joined: Nov 28th, 2022
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #13 - Dec 1st, 2022 at 12:30pm
Print Post  
Still not working

tried it with your path and

"debugServerPath": 

error message
Unable to start debugging. Unable to establish a connect to GDB.

output > debug has

Starting: "C:\ProgramData\VMicro\tools\openocd-rpi-0.10.0.20210623\bin\openocd.exe" -d2 -l \Debug/ScanNetworks.ino_DebugOpenOCD.log}" -s "C:\ProgramData\VMicro\tools\openocd-rpi-0.10.0.20210623/scripts/" -f robe.cfg" -f rp2040.cfg" -c "init"
Starting: c06\bin\arm-none-eabi-gdb.exe" --interpreter=mi
"C:\ProgramData\VMicro\tools\openocd-rpi-0.10.0.20210623\bin\openocd.exe" exited with code 1 (0x1).

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


Posts: 2145
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #14 - Dec 1st, 2022 at 12:42pm
Print Post  
Thanks for the update.

Can you also check there are no orphaned processes in Task Manager for "openocd.exe" or "arm-none-eabi-gdb.exe" before starting the debugging?

There should now be a log to attach in Debug/ScanNetworks.ino_DebugOpenOCD.log"

If there is no log file the command can be run via command line as below (no logging so all output is in the command window):
"C:\ProgramData\VMicro\tools\openocd-rpi-0.10.0.20210623\bin\openocd.exe" -d2 -s "C:\ProgramData\VMicro\tools\openocd-rpi-0.10.0.20210623/scripts/" -f robe.cfg" -f rp2040.cfg" -c "init"
  
Back to top
 
IP Logged
 
colinm
Junior Member
**
Offline


Posts: 13
Joined: Nov 28th, 2022
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #15 - Dec 1st, 2022 at 1:24pm
Print Post  
no I can't see any. I will restart my pc to ensure this is the case

ScanNetworks.ino_DebugOpenOCD.log file found here is the contents

Info : only one transport option; autoselect 'swd'
Warn : Transport "swd" was already selected
adapter speed: 5000 kHz

embedded:startup.tcl:26: Error: Can't find p2040.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 26

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


Posts: 2145
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #16 - Dec 1st, 2022 at 2:11pm
Print Post  
Thanks for this, it is my mistake in the JSON file, the debugServerArgs should be:
Code
Select All
  "debugServerArgs": "-d2 -l picoprobe\\Debug/ScanNetworks.ino_DebugOpenOCD.log}\" -s \"C:\\ProgramData\\VMicro\\tools\\openocd-rpi-0.10.0.20210623/scripts/\" -f picoprobe.cfg\" -f 040.cfg\" -c \"init\"", 

  
Back to top
 
IP Logged
 
colinm
Junior Member
**
Offline


Posts: 13
Joined: Nov 28th, 2022
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #17 - Dec 1st, 2022 at 2:29pm
Print Post  
sorry to say it still doesn't work

error message is

Unable to start debugging. Unexpected GDB output from command "-exec-run". Don't know how to run


output > debug is


openocd: Open On-Chip Debugger 0.10.0+dev-g18b4c35 (2021-06-24-12:15)
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 (GDB) 8.2.50.20190202-git
Copyright (C) 2019 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-w64-mingw32 --target=arm-none-eabi".
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="pagination",value="off"
Warning: Exceptions are not supported in this scenario.
The program '' has exited with code 42 (0x2a).
« Last Edit: Dec 1st, 2022 at 2:29pm by colinm »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #18 - Dec 1st, 2022 at 2:39pm
Print Post  
Thanks, can you attach the OpenOCD.log again from the build folder?
  
Back to top
 
IP Logged
 
colinm
Junior Member
**
Offline


Posts: 13
Joined: Nov 28th, 2022
Re: Raspberry Pi Pico W: "Unable to start debugging. Unexpected GDB output ...
Reply #19 - Dec 1st, 2022 at 2:47pm
Print Post  
file as requested

Info : only one transport option; autoselect 'swd'
Warn : Transport "swd" was already selected
adapter speed: 5000 kHz

Info : Hardware thread awareness created
Info : Hardware thread awareness created
Info : RP2040 Flash Bank Command
Info : clock speed 5000 kHz
Info : SWD DPIDR 0x0bc12477
Info : SWD DLPIDR 0x00000001
Info : SWD DPIDR 0x0bc12477
Info : SWD DLPIDR 0x10000001
Info : rp2040.core0: hardware has 4 breakpoints, 2 watchpoints
Info : rp2040.core1: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for rp2040.core0 on 3333
Info : Listening on port 3333 for gdb connections
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint