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) GDB Zero Debug Failure - "Unexpected GDG Output ..." (Read 17857 times)
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
GDB Zero Debug Failure - "Unexpected GDG Output ..."
Mar 4th, 2016 at 2:31pm
Print Post  
I loaded the blink program onto the Zero using a Visualmicro GDB project successfully several times but this stopped working upon trying the debug feature. 

VS2015 Pop-ups were:

1.
Unable to start debugging. Unexpected GDB output from the command "2-target-select remote localhost:3333", localhost:3333: The system tried to join a drive to a directory or a joined drive.

2.
"monitor" command not supported by this target.

The final error message at the bottom of the output window is: 

"Error: unable to open CMSIS-DAP device 0x3eb:0x2157
Error: No Valid JTAG Interface Configured."

I then reverted to simply uploading the previously working Arduino project imported into VisualMicro the The final error message at the bottom of the output window is: 

Error: couldn't bind to socket: Address already in use.

Rebooting PC did not help. When the Zero reset button is held down the LED stays off but once released the previously load blink program resumes. Two quick presses has no effect, excepting that the blinking LED stays off whilst reset is pressed.

Both output listings attached.

In a Winmerge comparison of the two outputs the last page of this shows that there is a difference regarding quotes and modification of path names. For example:

o/share/openocd/scripts/" -f
hare/openocd/scripts/ -f

UPDATE

With Atmel Studio 7.0.790 and following https://learn.adafruit.com/proper-step-debugging-atsamd21-arduino-zero-m0/lets-g... it is possible to get the Atmel debugger running as shown in the adafruit link. This upgraded the Zero firmware to 3.0c (I think) before debugger started successfully.
« Last Edit: Mar 4th, 2016 at 4:20pm by RBB01 »  

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #1 - Mar 4th, 2016 at 5:59pm
Print Post  
Hi,

Thanks for the post. Are you saying that after upgrading the firmware debugging now works correctly in visual studio?
  
Back to top
IP Logged
 
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #2 - Mar 5th, 2016 at 3:52pm
Print Post  
Tim@Visual Micro wrote on Mar 4th, 2016 at 5:59pm:
Hi,

Thanks for the post. Are you saying that after upgrading the firmware debugging now works correctly in visual studio?


Unfortunately not. The full Output window is produced below, but the last part reads:

Upload failed
Open On-Chip Debugger 0.9.0-gd4b7679 (2015-06-10-22:24)
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Runtime Error: iants/ARDUIN~1/OPENOC~1/ARDUIN~1.CFG:21: Can't find interface/cmsis-dap.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file riants/ARDUIN~1/OPENOC~1/ARDUIN~1.CFG", line 21

A similar problem is occurring with Arduino.cc 1.6.7, described at https://forum.arduino.cc/index.php?topic=383688.0

####### Output window ###############

Compiling 'GDB02' for 'Arduino/Genuino Zero (Programming Port)'
Build folder: 
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines: 
Architecture Tools: .3-2014q1/bin/
Sketchbook: file:\\\C:\Users\me\Documents\Arduino
Sketch Include Paths
Include Path 'C:\Users\me\Documents\Visual Studio 2015\Projects\GDB02\GDB02'
Core Include Paths
Include Path arduino'
Include Path ts\arduino_zero'
8.3-2014q1\bin\arm-none-eabi-g++"  -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10607 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON -DUSB_MANUFACTURER="\"Arduino LLC\"" -DUSB_PRODUCT="\"Arduino Zero\""     CMSIS/Include/" Device/ATMEL/"  s\arduino" ants\arduino_zero" cpp" -o "nul"
Build Core Paths: rduino
Using previously compiled file: pp.o
8.3-2014q1/bin/arm-none-eabi-gcc" "-LC:\Users\me\AppData\Local\V.Micro\Arduino\Builds\GDB02\arduino_zero_edbg" -Os -Wl,--gc-sections -save-temps ants\arduino_zero/linker_scripts/gcc/flash_with_bootloader.ld" bg/GDB02.ino.map" --specs=nano.specs --specs=nosys.specs -mcpu=cortex-m0plus -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -o ino.elf" cpp.o" -Wl,--start-group -lm " -Wl,--end-group
8.3-2014q1/bin/arm-none-eabi-objcopy" -O binary ino.elf" ino.bin"
Binary sketch size: 8,156 bytes (used 3% of a 262,144 byte maximum) (8.03 secs)
 
Uploading to I/O board using 'COM17'
Uploader started for board Arduino/Genuino Zero (Programming Port)
Upload method will be: bootloader
Uploading via Bootloader 
\bin\openocd.exe -d2 -s o/share/openocd/scripts/" -f iants/ARDUIN~1/OPENOC~1/ARDUIN~1.CFG -c "telnet_port disabled; program .ino.bin}} verify reset 0x00002000; shutdown"
Upload failed
Open On-Chip Debugger 0.9.0-gd4b7679 (2015-06-10-22:24)
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Runtime Error: iants/ARDUIN~1/OPENOC~1/ARDUIN~1.CFG:21: Can't find interface/cmsis-dap.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file riants/ARDUIN~1/OPENOC~1/ARDUIN~1.CFG", line 21

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #3 - Mar 5th, 2016 at 4:53pm
Print Post  
Thanks. 

The error is the upload attempt and unconnected to debug. If you click "debug>start without debugging" you should see the same error.

Can you upload using the arduino 1.6.7 ide?

Have you burnt a new bootloader? Sometimes the atmel tools remove it.

« Last Edit: Mar 5th, 2016 at 4:54pm by Tim@Visual Micro »  
Back to top
IP Logged
 
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #4 - Mar 6th, 2016 at 10:00am
Print Post  
Tim@Visual Micro wrote on Mar 5th, 2016 at 4:53pm:
Thanks. 

Can you upload using the arduino 1.6.7 ide?

Have you burnt a new bootloader? Sometimes the atmel tools remove it.



Upload on Arduino IDE 1.6.7 gives the same error; it also fails to burn a bootloader, see https://forum.arduino.cc/index.php?topic=383688.0

However, I can run Atmel Studio 7.0.790 in debug and step through the code, so the Zero is working. I presume the bootloader is lost once I uploaded the program in AS7 but the Visualmicro debug failed as described above before I ran the Zero in AS7.

In conversations with Atmel some weeks ago, as at 13/01/15 AS7 did not support Due/Zero code imported from Arduino.cc IDE. Hence it is unlikely that the Zero board was used in AS7 as it was not possible to select this board in  AS7 at the time. The Zero was not supported in 1.6.7 at that date either. For these reasons I have not knowingly used the Zero until trying to debug in Visualmicro as reported above.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #5 - Mar 6th, 2016 at 1:29pm
Print Post  
Hi,

Thanks for the info. The Zero has been working with Arduino 1.6 for many months and we have burnt many bootloaders.  I think we should ignore anything that Atmel say because they always try to avoid the native Arduino route and kill the bootloaders.

Before attempting to burn the bootloader, which "programmer" was selected on the Visual Micro programmers menu? 

The link you have provided above to the arduino forum was posted by a confused user. The "Arduino As ISP" was most probably not what the user wanted to select, there is a specific edbg programmer in the list for the Zero.

Thanks
« Last Edit: Mar 6th, 2016 at 1:31pm by Tim@Visual Micro »  
Back to top
IP Logged
 
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #6 - Mar 6th, 2016 at 7:02pm
Print Post  
Tim@Visual Micro wrote on Mar 6th, 2016 at 1:29pm:
Hi,

Before attempting to burn the bootloader, which "programmer" was selected on the Visual Micro programmers menu? 

Thanks


Attempts to burn a bootloader in 1.6.7 are detailed in https://forum.arduino.cc/index.php?topic=383688.0

For Visualmicro just did the following:

VisualMicro.programmer= Atmel EDBG "Always Use Programmer For Upload" ticked and also "Always Use Programmer For Upload" unticked

(In Control Panel\Hardware and Sound\Devices and Printers,  EDBG CMSIS-DAP does not show a port number but it shows COM18 in Visualmicro)

In both cases, same error:
###################
Burning a new bootloader
Burning bootloader to board 'Arduino/Genuino Zero (Programming Port)' using 'Atmel EDBG'
\bin\openocd.exe -d2 -s o/share/openocd/scripts/" -f ts/arduino_zero/openocd_scripts/arduino_zero.cfg" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program oaders/zero/samd21_sam_ba.bin}} verify reset; shutdown"
Open On-Chip Debugger 0.9.0-gd4b7679 (2015-06-10-22:24)
System.Exception: Burn bootloader failed with an exception ---> Visual.Micro.MiroAppAPI.debug.RunnerException: Upload failed

   at Visual.Micro.MiroAppAPI.debug.Uploader.executeUploadCommand(ICollection commandDownloader, String workingPath)
   at Visual.Micro.MiroAppAPI.debug.Uploader.executeUploadCommand(ICollection commandDownloader)
   at  programmerPrefs, String programmer)
   --- End of inner exception stack trace ---
   at  programmerPrefs, String programmer)
   at Visual.Micro.MiroAppAPI.debug.AvrdudeUploader.burnBootloader(Board boardPreferences, String programmerName)
Burn failed
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Runtime Error: s/arduino_zero/openocd_scripts/arduino_zero.cfg:21: Can't find interface/cmsis-dap.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file ts/arduino_zero/openocd_scripts/arduino_zero.cfg", line 21
###############

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #7 - Mar 6th, 2016 at 8:15pm
Print Post  
The "always use programmer" menu is ignored when burning bootloader.

Can you burn the bootloader using the arduino ide?
  
Back to top
IP Logged
 
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #8 - Mar 7th, 2016 at 9:07am
Print Post  
The various attempts to burn a bootloader in 1.6.7 are detailed in the link given above,  https://forum.arduino.cc/index.php?topic=383688.0

This include using an Atmel ICE. All failed.

However this does not address the OP, namely the error which occurred when trying to debug in Visualmicro.

Also, can your new debugger be used with an Atmel ICE and some other board such as a Due?

Thanks
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #9 - Mar 7th, 2016 at 10:41am
Print Post  
All external programmers such as Atmel ICE and Arduino as ISP are not required. The Zero has an on board programmer which is why you simply need to connect usb to the native debug port and burn a bootloader. This is the first arduino board that has this built in capability.

If I look at your first post in this thread I see different issues than your later posts where upload is failing. However your earlier posts might be the result of debug attempt after failed upload. This is why I am trying to clearly see that you can upload using arduino 1.6 / visual micro.

If you can not perform a normal upload using arduino 1.6 then we can't do arduino compatible debug.
  
Back to top
IP Logged
 
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #10 - Mar 7th, 2016 at 11:40am
Print Post  
Tim@Visual Micro wrote on Mar 7th, 2016 at 10:41am:
All external programmers such as Atmel ICE and Arduino as ISP are not required.


As the standard 1.6.7 upload failed I tried Atmel ICE as an alternative.

Tim@Visual Micro wrote on Mar 7th, 2016 at 10:41am:
However your earlier posts might be the result of debug attempt after failed upload. 


1. I loaded several variants of Blink onto Zero with Visualmicro to demonstrate that it was uploading successfully.
2. Tried Visualmicro debug, which failed as per OP.
3. I loaded several variants of Blink onto Zero with Atmel Studio 7  to demonstrate that it was uploading successfully.
4. Ran debug successfully in Atmel Studio 7.
5. Attempted to burn bootloader in 1.6.7, as detailed in https://forum.arduino.cc/index.php?topic=383688.0
6. Attempted to burn bootloader in Visualmicro as detailed in above posts.

Tim@Visual Micro wrote on Mar 7th, 2016 at 10:41am:
If you can not perform a normal upload using arduino 1.6 then we can't do arduino compatible debug.


There appears to be something wrong with my setup of 1.6.7 which is why raised https://forum.arduino.cc/index.php?topic=383688.0

Are you saying that even though  step 1. above was successful it does not necessarily follow that the debug would also work?

Thanks

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #11 - Mar 7th, 2016 at 1:00pm
Print Post  
Thanks for the info. The only programmer you can use (unless you have your own ICE) is the edbg and you need that selected to be able to burn a bootloader.

Normal upload should work just fine if you have a bootloader.

Your upload report is this which shows it fails...

Code
Select All
Uploading to I/O board using 'COM17'
Uploader started for board Arduino/Genuino Zero (Programming Port)
Upload method will be: bootloader
Uploading via Bootloader

\bin\openocd.exe -d2 -s
o/share/openocd/scripts/" -f
iants/ARDUIN~1/OPENOC~1/ARDUIN~1.CFG -c "telnet_port disabled; program
.ino.bin}} verify reset 0x00002000; shutdown"
Upload failed 



I suspect from your reports that upload was working. 

Starting a debug session with visual micro does not alter anything on the board in the same way that atmel can do. So the debug attempt with visual micro is unrelated to the current upload issue.

The visual micro debug can fail (not often) if the board is in a strange state when the debug attempts to start. In this case the openOCD.exe process can be killed via task manager. If openOCD.exe has not been shut down you can see some of the errors in your first report.

However lets ignore debug in our discussions until the upload works. If you are unable to burn a bootloader using the (edbg programmer from the list) in either visual micro or arduino then your board is no longer arduino compatible. I haven't seen that before but then again I haven't used the atmel tools or upgraded any firmware from the standard that arduino provides.
  
Back to top
IP Logged
 
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #12 - Mar 7th, 2016 at 1:15pm
Print Post  
Thanks.

Can your new debugger be used with an Atmel ICE and some other board such as a Due? I need to step through code so the old debugger does not suit.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #13 - Mar 7th, 2016 at 1:47pm
Print Post  
If you are using the a gdb project on the program port with visual micro then you get step through.

If you are using a standard project with serial debug on any port or pins then no step through.
« Last Edit: Mar 7th, 2016 at 1:49pm by Tim@Visual Micro »  
Back to top
IP Logged
 
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #14 - Mar 7th, 2016 at 4:13pm
Print Post  
Tim@Visual Micro wrote on Mar 7th, 2016 at 1:47pm:
If you are using the a gdb project on the program port with visual micro then you get step through.

If you are using a standard project with serial debug on any port or pins then no step through.


I successfully uploaded blink variants to a Due using 1.6.7 and also with Visualmicro GDB.

Debug in Visualmicro simply loads the latest blink program onto the Due board, it does not stop at the breakpoint
digitalWrite(13, HIGH); 

The Atmel ICE does not show up Visualmicro.Programmer, though it is visible at Control Panel\Hardware and Sound\Devices and Printers though it is not obviously assigned to a particular port.

What is the correct set-up to step through code on a Due in Visualmicro?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #15 - Mar 7th, 2016 at 6:41pm
Print Post  
Hi,

Only the Zero is supported for GDB at the moment. The gdb support can be extended but it is new and won't be documented for a few weeks. Standard support for Due and Jtag etc will follow shortly. I and others have tested gdb with both the Zero from arduino.cc and the version from arduino.org

The Due will be debugging in Serial debug mode...

> If you have ticked the "Visual Micro>Trace Only" menu item then it will not stop at breakpoints. 
> If you have added a "when hit" message and the "continue execution" checkbox is not set then it will not stop at the breakpoint
> If the breakpoint is on an "If" statement the break will be inside the "If" (in background, the serial debugger injects code after the current line and inserts {braces} where needed.

With the Zero board selected, it would be useful to see a picture of your ide with the visual micro menu dropped down prior to attempting to burn bootloader?

  
Back to top
IP Logged
 
RBB01
Junior Member
**
Offline


Posts: 24
Joined: Mar 3rd, 2016
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #16 - Mar 8th, 2016 at 10:14am
Print Post  
Tim@Visual Micro wrote on Mar 7th, 2016 at 6:41pm:
Hi,

With the Zero board selected, it would be useful to see a picture of your ide with the visual micro menu dropped down prior to attempting to burn bootloader?



Attached.
  

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: GDB Zero Debug Failure - "Unexpected GDG Output ..."
Reply #17 - Mar 16th, 2016 at 9:15pm
Print Post  
Hi

This post has become a bit confusing and I having having problems helping you.

Only the Zero supports GDB debug I suggest you open a new thread specifically for the Zero and GDB

The Arduino Due does not support GDB debug at the moment but it can use the Visual Micro serial debugger but again that is best discussed in a new thread. Halting at breakpoints is optional so if you would like to discuss that make sure you describe your breakpoint settings and also confirm that you have not enabled the TraceOnly option on the visual micro menu.

When you create threads please avoid any discussion about ICE programmers unless for the Zero.

Visual Micro does not upload code that changes the way the Zero works or change device driver etc. To upload we  just run the tools provided by your Arduino Ide Zero config. When you debug using GDB with Visual Micro we just run the tools that enable debug they do not change the program on the board. First the normal upload happens then the OpenOCD/GDB debugger is run, therefore the two processes are separate. If there is a com error with the board the OpenOCD process can be left in memory causing upload issues. This doesn't happen normally but you can use task manager to kill OpenOCD instead of rebooting.

If you want to discuss the Zero please confirm that you can upload to the board using the Arduino Ide. If not then it sounds like you might have a faulty board. If you can upload with the arduino ide then visual micro should also work if not then I will help you switch on the verbose setting and ask you to post a full output.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint