Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Debugging with jtagice & DebugWire? (Read 376 times)
Nebulous
Junior Member
**
Offline



Posts: 7
Debugging with jtagice & DebugWire?
Nov 28th, 2018 at 3:41pm
 
Hi,
I am trying to use Visual Micro for debugging, but am not having any luck.

I have Atmel Studio 7 + "Arduino IDE for Atmel Studio 7" V 1811.24.0 installed.

I want to use my jtagice mk2 in DebugWire mode to debug an arduino .ino project (blinky example) on a custom board with a ATMega328PB.

I have a know good hardware setup and can debug native Atmel Studio project without a problem.

Is this supported?
There doesn't seem to be an option for it in vMicro - Uploader - Programmer:
The closest is "Atmel Studio JTAG ICE MK2 (ISP)"

I have already fused my target micro for DebugWire (thus disabling ISP) so I wasn't surprised it didn't download, but don't know how to proceed.

Any help would be appreciated.

If I try to debug, the message window shows this:

Code:
Uploading 'Sketch1' to 'Atmel atmega328pb Xplained mini' using 'Atmel Studio JTAG ICE MK2 (ISP)'
[ERROR] An unexpected error occurred when executing.
Traceback (most recent call last):
  File "atmel\atprogram.py", line 48, in run
Error during upload using programmer
The uploader process failed

The uploader process failed
  File "atmel\avr\cli\commandline.py", line 54, in execute_commands
The uploader returned an error
  File "atmel\avr\cli\commandexecutor.py", line 52, in execute_commands
  File "atmel\avr\cli\resourcemanager.py", line 44, in prepare_resources
  File "atmel\avr\cli\resourcemanager.py", line 51, in _prepare_resource
  File "atmel\avr\cli\resourcecontainers.py", line 54, in allocate
  File "atmel\avr\cli\backend.py", line 134, in start
  File "subprocess.py", line 702, in __init__
  File "subprocess.py", line 823, in _get_handles
WindowsError: [Error 6] The handle is invalid
 

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



Posts: 9493
United Kingdom
Re: Debugging with jtagice & DebugWire?
Reply #1 - Nov 28th, 2018 at 8:07pm
 
Visual Micro is a serial debugger.

In Atmel studio use the "Atmel device programming" programmer. This then hands over to standard atmel studio device programming for the project. (see atmel user guide)

If you want to debug using atmel debug then you need to follow the instructions on the visual micro atmel studio 7 page or use the atmel project converter.

If you want to use device programming or programmer for upload and then use the visual micro serial debugger then set the local and remote port on the vMicro>Debugger menu
Back to top
 
WWW  
IP Logged
 
stevewidg
Junior Member
**
Offline



Posts: 5
Re: Debugging with jtagice & DebugWire?
Reply #2 - Nov 29th, 2018 at 3:42pm
 
Hi
I get EXACTLY same error message trying to use an Atmel Ice  using Atmel Studio ICE-ISP  under VM with'always use programmer' selected and Atmel ICE ISP selected under tools.It programs fine using TOOLS>PROGRAM etc.
Any Suggestions
PLease
Steve
Back to top
 
 
IP Logged
 
Nebulous
Junior Member
**
Offline



Posts: 7
Re: Debugging with jtagice & DebugWire?
Reply #3 - Nov 29th, 2018 at 5:05pm
 
Visual Micro wrote on Nov 28th, 2018 at 8:07pm:
Visual
If you want to debug using atmel debug then you need to follow the instructions on the visual micro atmel studio 7 page or use the atmel project converter.

Do you have any links to those instructions?
I found this page but it doesn't explain anything.

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



Posts: 9493
United Kingdom
Re: Debugging with jtagice & DebugWire?
Reply #4 - Nov 29th, 2018 at 5:58pm
 
The visual studio extension link in the page you posted is what you want.

It is also in the links at the top of the visual micro home page
Back to top
 
WWW  
IP Logged
 
Nebulous
Junior Member
**
Offline



Posts: 7
Re: Debugging with jtagice & DebugWire?
Reply #5 - Nov 30th, 2018 at 3:11pm
 
Thanks VM. I have read through that page and I still can't get it to work.
When I try to debug (the green play button), it invokes the "Device programming" dialog as if it is set for ISP. When I do that in a native AS7 project I don't see that and it automatically downloads via DebugWire where I can then run, step etc.

Setup:
  • My project has an empty "Sketch1.ino" file.
  • A "Sketch1.cpp" file containing the arduino blink sketch plus #include <arduino.h> as the first line.
  • In project Properties>Tool I set the programmer to JTAGICE mkII and interface to debugWIRE.
  • vMicro>Uploader>Programmer is set to "Atmel Studio Device Programming" and "Always use programmer for upload" is ticked.
  • vMicro>Debugger>Atmel Studio Debugger is ticked.

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



Posts: 9493
United Kingdom
Re: Debugging with jtagice & DebugWire?
Reply #6 - Dec 1st, 2018 at 1:00am
 
If I recall you can "right click > project name > project properties" then set the Tool.

Are you using avr or sam or samd?
Back to top
 
WWW  
IP Logged
 
Nebulous
Junior Member
**
Offline



Posts: 7
Re: Debugging with jtagice & DebugWire?
Reply #7 - Dec 1st, 2018 at 10:45am
 
Visual Micro wrote on Dec 1st, 2018 at 1:00am:
If I recall you can "right click > project name > project properties" then set the Tool.
Yes, that's what i did.

Visual Micro wrote on Dec 1st, 2018 at 1:00am:
Are you using avr or sam or samd?
Avr.

The problem I have is that when I hit the "Start Debugging" button, instead of seeing in the bottom left corner of the IDE "Writing %", followed by "Running" like a native project would, the "Device Programming" dialog pops up, from which there is no way to activate debugging.
It is as if the "Start Debugging" button is being overridden by an incorrect command somewhere. Or maybe the vMicro>Debugger>Atmel Studio Debugger selection is being ignored.  Sad
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9493
United Kingdom
Re: Debugging with jtagice & DebugWire?
Reply #8 - Dec 1st, 2018 at 2:46pm
 
Is "vmicro>debugger>use atmel studio debugging" enabled?
Back to top
 
WWW  
IP Logged
 
Nebulous
Junior Member
**
Offline



Posts: 7
Re: Debugging with jtagice & DebugWire?
Reply #9 - Dec 1st, 2018 at 3:32pm
 
Yes, that is ticked.

edit:
although the word "use" is not there.
Back to top
« Last Edit: Dec 1st, 2018 at 3:37pm by Nebulous »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9493
United Kingdom
Re: Debugging with jtagice & DebugWire?
Reply #10 - Dec 1st, 2018 at 3:37pm
 
pls zip and attach your .cppproj file

Thanks
Back to top
 
WWW  
IP Logged
 
Nebulous
Junior Member
**
Offline



Posts: 7
Re: Debugging with jtagice & DebugWire?
Reply #11 - Dec 1st, 2018 at 3:43pm
 
zip file attached. Thanks.
Back to top
 

Sketch1_002.zip (6 KB | 4 )
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9493
United Kingdom
Re: Debugging with jtagice & DebugWire?
Reply #12 - Dec 2nd, 2018 at 12:08pm
 
Sadly, once you are in native atmel mode there is little I can do to help via Visual Micro.

Your project looks okay to me. The ccp proj files are just text/xml you can look in them and change them if required.

I used "File>New>Arduino Project" to create a Test project and used Atmel to create a GCC executable. Then compared the two projects and they look the same.

What do you see different?



note: You will see that I have used a standard arduino project for comparison. The .ino/cpp file naming configuration is not relevant to this discussion of "tools".

Back to top
 

as7-avr8.png (99 KB | 0 )
as7-avr8.png
WWW  
IP Logged
 
Nebulous
Junior Member
**
Offline



Posts: 7
Re: Debugging with jtagice & DebugWire?
Reply #13 - Dec 3rd, 2018 at 1:00pm
 
Visual Micro wrote on Dec 2nd, 2018 at 12:08pm:
I used "File>New>Arduino Project" to create a Test project and used Atmel to create a GCC executable. Then compared the two projects and they look the same.

What do you see different?


I have done the same and see the same as your screenshots. (or did you mean to compare the .cppproj file?)

Back to top
« Last Edit: Dec 3rd, 2018 at 1:02pm by Nebulous »  

as7ScrShot.png (138 KB | 0 )
as7ScrShot.png
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9493
United Kingdom
Re: Debugging with jtagice & DebugWire?
Reply #14 - Dec 3rd, 2018 at 1:09pm
 
Maybe something has changed in as7, it's can be difficult at times.

We might have to compare the two ccpproj project files to see what might be missing.

The problem is that Visual Micro doesn't have to do anything when you switch to atmel mode. So we just need to ensure the correct project properties are set.
Back to top
« Last Edit: Dec 3rd, 2018 at 1:09pm by Visual Micro »  
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print