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) How to use STK600 and/or JTAGICE with coompiled sketches? (Read 15639 times)
Alexander12
Newbies
*
Offline


Posts: 9
Joined: Jun 5th, 2013
How to use STK600 and/or JTAGICE with coompiled sketches?
Jun 5th, 2013 at 6:30pm
Print Post  
I want to use arduino framework but be able
1. have flexibility with hardware using my STK600
2. be able to debug sketches using true hardware debuging using JTAGICE3 which I can use with traditional projects inside AtmelStudio

I'm having problems with arduino sketches inside AtmelStudio - programmer and debugger cannot find hex/elf file
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #1 - Jun 5th, 2013 at 8:20pm
Print Post  
I don't think Arduino supports this which is why we have a USB debugger.

In future versions we hope to use the std Atmel output folder so the hex and elf would be found but I still don't think it will work.

Of course you can stop using the pde/ino system and revert to a std Atmel Studio project with a "main" source file, but then you will not have an Arduino compatible compile and I still believe it would fail.

If you have an Atmel project without ino/pde then Visual Micro will "go silent" and not manage the project for you. You will be back to raw Atmel Studio.
  
Back to top
WWW  
IP Logged
 
Alexander12
Newbies
*
Offline


Posts: 9
Joined: Jun 5th, 2013
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #2 - Jun 5th, 2013 at 10:10pm
Print Post  
I see
But what is a difference in nature in elf generated by visualmicro and the one generated by traditional atmelstudio build?
If I understand it correctly - atmelstudio just need standard elf file to initiate debugging session
At least external compilers (like IAR, CodeVision, MicroC) are doing exactly this way - they provide ELF to AtmelStudio to debug their code.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #3 - Jun 5th, 2013 at 10:27pm
Print Post  
Sounds like it should work, the sim seemed to work so the debug should work.

Are you going to try it?
  
Back to top
WWW  
IP Logged
 
Alexander12
Newbies
*
Offline


Posts: 9
Joined: Jun 5th, 2013
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #4 - Jun 6th, 2013 at 11:59am
Print Post  
I can try it with my jtagice3 but for this I need to locate ELF file
How to find it after compilation?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #5 - Jun 6th, 2013 at 12:15pm
Print Post  
Hi switch on options "compiler>always show build folder"

This will give you a link to the build folder

CTRL+CLICK to open the folder or just copy and use the link as required

Don't forget you can also upload using a programmer from Visual Micro. Take a look at the "tools menu > upload using programmer"

Thanks

Simulator example here uses same system http://www.visualmicro.com/post/2013/06/05/How-to-start-the-Atmel-Simulator-Ardu...
« Last Edit: Jun 6th, 2013 at 12:16pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
PPTSAK
Newbies
*
Offline


Posts: 2
Joined: May 31st, 2013
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #6 - Jun 9th, 2013 at 11:40am
Print Post  
Thank you very much for sharing this information Smiley 

Arduino uses AVR328 , so the only posibility of using Hardware debugger is with "one wire On Chip Debug" interface called debugWire debug ex.  Dragon

Thank you again
Takis Tsaknakis
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #7 - Jun 9th, 2013 at 12:31pm
Print Post  
Hello,

Yes some Arduinos use 328 but there are other chips. However the usb debugger is available because hardware debug is not an easy or often practical solution for Arduino.

Thanks for the info, look forward to hearing of any other questions or issues in this forum Smiley
  
Back to top
WWW  
IP Logged
 
Alexander12
Newbies
*
Offline


Posts: 9
Joined: Jun 5th, 2013
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #8 - Jun 15th, 2013 at 1:31pm
Print Post  
Most of atmel chips can be debugged using hardware debugger, may be just except atmega8. 
Yes, atmega328 can use debugWire, it needs just one signal wire to be connected (reset line). For mega2560 jtag is an option.
Will try arduino with my jtagice3 and will let you know
  
Back to top
 
IP Logged
 
NF1Z
Junior Member
**
Offline


Posts: 49
Joined: Aug 18th, 2013
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #9 - Aug 19th, 2013 at 3:23am
Print Post  
Looks like the topic is getting a bit old, but this may be useful.

I needed to use a HW debugger with Atmel Studio 6.1SP2 on Windows 7 for a Uno, but wanted the final debugged product to be Arduino-compatible.   I tried the method suggested to open an object file debugging session, and I have to report it works fine with the simulator and also with the AVR Dragon debugWire debugger.  You may need to locate some source files for the debugger, but otherwise it is very similar to a standard AS project.

I did try to copy the .elf file to the Arduino project/sketch, in the hope the debugger would just work according to the project tool properties, but those properties don't seem to work fully for an Arduino project, so no luck. It would be good to be able to opt to use the standard project tool properties instead of the Arduino setup.

A couple of related points on this topic that might not be generally known:  if you have installed the AtmelUSB driver, the AVR Dragon is tied to AS and can't be accessed by avrdude, even from inside AS or even if AS is not running: you have to use the AS Device Programming menu.  If you don't install AtmelUSB, you can use avrdude, but you can't use the AS Device Programming menu, so no debugging in AS.  I had no luck trying to install the libusb_win "filter" driver, but the regular driver worked fine.

Also, if you are programming an Arduino (or anything else) with a capacitor attached to RESET, debugWire will not work and the MCU will probably end up brain dead, stuck in debugWire mode but not responding to it - bad news.  For the same reason, it's good to disable debugWire before you exit AS.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #10 - Aug 19th, 2013 at 11:55am
Print Post  
Thanks for the update. As you have seen hardware debug with Arduino is a no no for most users this is why we have the simpler usb debugger. The usb debugger is much less hassle, works with standard Arduino projects and a usb or ftdi cable.
  
Back to top
WWW  
IP Logged
 
NF1Z
Junior Member
**
Offline


Posts: 49
Joined: Aug 18th, 2013
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #11 - Aug 19th, 2013 at 1:25pm
Print Post  
Oh, I agree entirely.  I was still using the Arduino IDE for the bulk of the job (I chose the Arduino/AVR platform over the PICs I used to use because of the IDE and C++), moving over to AS only when it occasionally became necessary to use the HW debugger.  That move was always avoided as long as possible, because it wasn't always easy, the Arduino compatability is lost, and HW debugging is inherently tricky anyway.  Atmel Studio with the VM extension provides a much better IDE, retains the Arduino compatability, has a very useful debugger, and allows me to do the whole thing in AS.  Very nice. 
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to use STK600 and/or JTAGICE with coompiled sketches?
Reply #12 - Aug 19th, 2013 at 2:23pm
Print Post  
That is good to hear but thank you for the great information about HW debug. It answers the questions very well!
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint