Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 

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 and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Debugging ATTiny461A using Atmel Ice Mk2 in v micro (Read 431 times)
Tristan Nebe
Newbies
*
Offline



Posts: 2
Debugging ATTiny461A using Atmel Ice Mk2 in v micro
Feb 16th, 2022 at 9:59am
 
Hi all,

I'm trying to get a setup working where I can use Arduino code and debug on a range of ATTiny devices.  Currently the ATTiny 461.

I came across V Micro which seems like an awesome solution for coding Arduino code in Atmel Studio.

I have managed to install V Micro etc in Atmel studio and I seem to be able to program my tiny through the ICE using ISP. 

However, I don't seem to be able to get the debugging working.  For some reason, the ICE does not show up in the Debug Hardware drop down as shown in the V Micro video.

https://www.youtube.com/watch?v=U4cEvN6oU5Y

I can't seem to see why the ICE mk2 is not listed in the drop down.  I have looked around online a lot and tried all kinds of things but can't seem to get it to show it the list.

Atmel Studio can definitely see the ICE so it is connected correctly and all.

I thought is maybe an issue with my trying to use it with a ATTiny (debug wire) device but it still didn't show if I set it to an Uno board.

Any advice would be really appreciated!  I'm not sure where to go from here.

My setup is
Atmel Studio 7
AtTiny461A using ATTinyCore v1.5
JTag ICE Mk2

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



Posts: 1456
Re: Debugging ATTiny461A using Atmel Ice Mk2 in v micro
Reply #1 - Feb 16th, 2022 at 4:52pm
 
For the AVR chips, the Atmel Studio debugging can be used alongside Visual Micro to deliver this, along with the changes needed for DebugWire.

Important Notes:-
1) Ensure your ATTiny Board is selected before creating the project with Visual Micro (this ensures 8-bit compatibility for this platform)
2) Set the "vMicro>Uploader>Programmer" to "Atmel Device Programming"
3) Check the "vMicro>Uploader>Use Programmer for Upload" menu
4) Check the "vMicro>Debugger>Atmel Studio Debugging" menu item, which allows the standard Atmel Studio debugging configuration and tools to take over when starting the debug session.

The last point (4) means the vMicro selected debugger is not used, and only the Atmel Studio debugging configuration from the Project Properties are used.
Back to top
 
 
IP Logged
 
Tristan Nebe
Newbies
*
Offline



Posts: 2
Re: Debugging ATTiny461A using Atmel Ice Mk2 in v micro
Reply #2 - Mar 15th, 2022 at 6:32pm
 
Hi Simon,

Thanks so much for your response!  I really appreciate it, and apologies for not responding sooner but other projects and life just kept me busy!

Your suggestions seemed to work.  Which is awesome!

I just want to send a huge thank your to everyone at Visual Micro for your efforts and what you guys have created here!  Its a huge help to me!  I'm wanting to (as with the project above) create projects with the ATTiny family of micro controllers and with them I'm not able to use the serial port for debugging etc.  I have a JTAG ICE Mk2 so can it however up till now I couldn't use it either as it wouldn't run in the Arduino IDE.  So Visual Micro is a complete game changer for me.

I am still having some small challenges though and would love some input into how best to work around these:

One being when creating new Arduino projects in Atmel Studio - going to File / New / Project / Arduino Project and filling in a new project name I have found that if i add spaces in the name it isn't able to set up correctly.  However also if I use a name apart from the default "sketch1" or something, Atmel Studio seems to be able not be able to connect to the Arduino libarary so calls such as digitalWrite aren't recognized and can't compile.  So at the moment I'm needing to just create projects and keep the name as default eg "sketch2" in a project folder that I can create.  Are there any tricks / work arounds I could use that I could use custom names and still keep the Arduino libraries linked?

The other being, once I have coded a project up and try to upload and debug (using start debugging (F5)) the sketch to the ATTiny.  Atmel Studio seems to first needs to upload the code to the micro through my ICE mk2 using ISP because I have selected my ICE mk2 as my programmer in Visual Micro, then Atmel Studio asks that I switch the micro to deBug Wire and reloads all the code using deBug Wire before going into debug step mode.  Which then works well.  However when I make some changes to the code and want to re up load the new changes, I need to disable debug wire so that when I click start debugging again, my ICE Mk2 can up load the new code to the micro using ISP agian,  It then switches to deBug Wire again and re uploads the code before entering debug mode again.  So essentially, it would be awesome if we could just skip the ISP up load and just stay in deBug Wire.  However I can't seem to select Visual Micos programmer to "No Programmer" or anything like that.  Is there some other way to skip the programmer and just stay with using Atmel Studios built in debug functionality? 

I would love to get this working properly as anyone who wants to use the tiny range of micros in the Arduino environment, Visual Micro would be as good as essential!  And if me creating a YouTube video of how to setup and use Visual Micro for Tiny micro controllers would help other users I'd be willing to put a video together.

On a side note, I see a lot your website is about using Visual Studio instead of Atmel Studio as a code environment.  Would you recommend I try and use Visual Studio instead of Atmel Studio?

Many thanks and looking forward to hearing back.

Regards,

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



Posts: 1456
Re: Debugging ATTiny461A using Atmel Ice Mk2 in v micro
Reply #3 - Mar 16th, 2022 at 11:34am
 
Thanks for the update, and glad you are enjoying Visual Micro.

Project Names with spaces in are not permitted in the Arduino specification, so this is best avoided altogether.  Adding underscores or hyphens is the simplest way to replace the spaces.
https://arduino.github.io/arduino-cli/0.21/sketch-specification/#sketch-folders-...

To use the Atmel Studio upload only, you can enable the vMicro > Uploader > "Atmel Studio Device Programming", and also ensure the vMicro > Uploader > "Enable Programmer for Uploads" is also enabled.  This should then allow Atmel Studio to perform all the programming without vMicro also performing the upload.

It never hurts to have a video to explain all of this, especially for newer users, so definitely a good idea to make a video.  Let us know if you would want it highlighted or added to our channel/playlists.

Visual Studio is often the better choice for many people, however as you are setting the DWEN fuse bit, this would be more manual configuration in Visual Studio, so in this case its likely best to stick with Atmel Studio.
Back to top
« Last Edit: Mar 16th, 2022 at 12:22pm by Simon@Visual Micro »  
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print