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
Normal Topic Debugging: Visual Studio -vs- Atmel Studio (Read 9356 times)
Gilles Plante
Full Member
***
Offline


Posts: 156
Location: Québec, Canada
Joined: Oct 31st, 2013
Debugging: Visual Studio -vs- Atmel Studio
Oct 31st, 2013 at 4:52pm
Print Post  
Hi to all of you,

I am looking for a alternative to the Arduino IDE, and some more things but that's something else. One of the shortcomings of the Arduino IDE is the lack of a debugger  Undecided.

So I found out about the VM plugin for Atmel and Visual Studio. I tried the VM serial debugger inside Atlem Studio but found out it can't single step from instruction to instruction as with other debuggers, for example the one in Dynamic C (Rabbit micro-controllers). In fact it can go from a Breakpoint to another one. For now I consider it to be a shortcoming, but I must add I haven't give it a thoroughly try. I must say though that there are some interesting features.

So my question is working with Visual Studio, would I get more from the VM debugger - I don't think so but it's worth asking.

Is there some way in Atmel Studio or Visual Studio to use complete debugging facilities like JTAG, SWD (Serial Wire Debug) or DebugWiRE with Arduino sketches ? If so that would be very nice  Smiley.

Thanks

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugging: Visual Studio -vs- Atmel Studio
Reply #1 - Oct 31st, 2013 at 6:49pm
Print Post  
Hi Gilles,

Thank you for the post and fair observations. You are right that the debugger currently only implements step between breakpoints. 

I will try to give a few "off the cuff" notes that might or might not be relevant....

It isn't just the Arduino that does not have debugging it is also the Arduino implementation of the Atmel Mcu. So there isn't any debug for Arduino. No JTAG or anything else unless you get a soldering iron and hack your board.

The Visual Micro debugger provides a lot of what is missing but does not provide all of the features of a hardware debugger. However, as you have intimated, it does provide a lot of features and many that are not provided by hardware debug systems. 

If you decide to persist with the debugger feel free to ask for prompts or how to do stuff. We are working on the next gen of the debugger at the moment, it looks like it will have step capability so it's always good to hear what it important to users of different experience levels.

Thanks again

nb: Existing debugger users, your license keys will be valid for the next gen tools  Smiley
  
Back to top
IP Logged
 
Gilles Plante
Full Member
***
Offline


Posts: 156
Location: Québec, Canada
Joined: Oct 31st, 2013
Re: Debugging: Visual Studio -vs- Atmel Studio
Reply #2 - Oct 31st, 2013 at 7:54pm
Print Post  
Hi Tim,

thanks for the prompt reply. Here is some more inputs regarding the debugging of Arduino boards. The DUE board based on an ARM chip provides a 10-pin JTAG connector as well as 4-pin SWD (Serial Wire Debug) connector. So connecting the PC to one of these connectors would let you implement or use Atmel Studio/Visual Studio provided functions.

Now regarding the plain vanilla boards based on AVR chips, I discovered this morning that even though no JTAG connections are provided, there is way to do hardware debugging through a feature from Atmel not well known. This would be done using the RESET pin of the CPU. Please see http://awtfy.com/2012/03/29/hardware-debugging-the-arduino-using-eclipse-and-the.... That page refers to http://awtfy.com/2010/02/21/modify-an-arduino-for-debugwire/, here is an extract:
Quote:
The chips used in the Arduino use Atmel’s fancy new proprietary method called “DebugWIRE.” JTAG uses a ten-pin connector and uses I/O lines that your circuit might want during debugging. DebugWIRE allegedly uses just one – the reset line.
This guy uses the AVR Dragon with the DebugWIRE technic. To do so, he removes the capacitor that let the USB port to reset the CPU. If that works fine, the you could provide hardware debugging capabilities easily maybe  Smiley.

When do you expect to have the next gen debugger available ?

Thanks

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugging: Visual Studio -vs- Atmel Studio
Reply #3 - Oct 31st, 2013 at 9:24pm
Print Post  
Hi,

Thanks for the information and the link. 

Yes there are many articles on the web about how to hack the Arduino hardware for debug but it is not the purpose of this project because it would be too complex for most users. Using Serial with Arduino is a well proven and robust mechanism that is also very flexible.

We have a number of forum members who have tried these other options and find that fuses on the boards need to be altered often causing the hardware to become useless. The feed back is that the Serial debugger is easier and less risky.

My understanding is that whilst the Atmel SAM processor has a hardware debug port Arduino have not made it possible to use. 

Our next gen might be a few months or more, it will still use serial so that users can just plugin and debug. This means that no additional hardware or hacking required. The next gen should also be more aware of data types and be able to get/set any data without needing to specify watch expressions prior to compile.

In both versions, we also hope to see better integration with the Atmel/VS debugger system and ability for things like "inspecting last known values" when hovering over variables in the code editor. 

In all of that if we find a robust and simple solution for users to perform hardware debug and can see how we could enhance the Atmel debug system we would be interested to explore this route.
« Last Edit: Oct 31st, 2013 at 9:33pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Gilles Plante
Full Member
***
Offline


Posts: 156
Location: Québec, Canada
Joined: Oct 31st, 2013
Re: Debugging: Visual Studio -vs- Atmel Studio
Reply #4 - Nov 1st, 2013 at 11:57am
Print Post  
Quote:
My understanding is that whilst the Atmel SAM processor has a hardware debug port Arduino have not made it possible to use.

That would be bad news. The Arduino project that targeted hobbyists and newcomers has evolved in  away they did not foresee. For my part, we find the Arduino ecosystem very appealing to industrial embedded systems. We can rapidly create a prototype and then we have to pick between integrating an Arduino board as is and create a shield of our own or design our own clone of a specific Arduino board.

I will search about the possibility or not to use hardware debugging with a plain DUE board and update this topic. I understand that you do not wish users to tamper with fuses, bricking a board should be avoided.

Edited:
I stopped after founding this on an Arduino forum: http://forum.arduino.cc//index.php?topic=190920.0 Someone succeeded debugging an Arduino DUE with the JTAG connector and a JTAG debugger. That doesn't not seem evident to use an hardware debugger: for example looks like JTAG is related to SWD. I can't tell more. Unfortunately the the guy didn't tell what IDE he used, compatible or not with the Arduino IDE.


Thanks

Gilles Plante
« Last Edit: Nov 1st, 2013 at 12:50pm by Gilles Plante »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugging: Visual Studio -vs- Atmel Studio
Reply #5 - Nov 1st, 2013 at 1:04pm
Print Post  
Hi Gilles,

If you find any information about how to use the debug port of the Due this would be VERY useful. Thanks!
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint