There are some threads throughout the forum on this topic, but either old or incomplete.
I would like to put together a tutorial on how to incorporate this device in the IDE, of course, if possible, so that it can be used as a reference.
What I know so far:
avrdude 6.1 and 6.2 support it (technically)
Windows drivers are not readily available (let me qualify that):
Atmel Studio presumably includes USB drivers, but that won't make the device visible to avrdude
in order for avrdude to "see" it, a libusb driver would be needed
my machine has libusb installed for my USBtinyISP, but ATMEL ICE was not detected
What I believe needs to be done next:
sort out the driver so that avrdude can use the device
sort out programmers.txt to include it (there is some info on that topic as well)
try it out...
One might ask: why?
Well, this is the big kahuna programmer. Yes, expensive, more than a Mega, but it does quite a lot.
Maybe not appealing to Arduino enthusiasts because of the price, but it's definitely out there.
My reason - it does PDI programming as well, so I want to try it on my xmega.
What do you guys think?
Is this worthwhile pursuing?
jremington:
Atmel Studio 7 supports Arduino code and programming.
Libraries and all?
My IDE is now set up with all the stuff I need, libraries, programmers, boards.
Since I never used AS, I thought sticking to a familiar environment would be ideal.
I'm struggling to get AS7 and the Atmel ICE to talk to a Mega2560 board. So far I've been able to program it, but no debugging capability. A couple of web pages suggested that AVRdude should be loaded into Atmel Studio (they reference v 6.2) as an external tool, but they all reference the use of the old COMM ports - which I don't have. I just downloaded version 6.3 of AVRdude. In the config file it says that it supports USB ports but that's as far as I've been able to get. No success in getting communication setup between SAS7 and the Mega board. I did find a little exe "USB View" that provided detailed information about what was connected to each USB port, but I have no idea how to use that information.
I have no problem purchasing a programmer if it works. Is there a recommendation for a programmer?
I'm struggling to get AS7 and the Atmel ICE to talk to a Mega2560 board. So far I've been able to program it, but no debugging capability - which is critical for my application. A couple of web pages suggested that AVRdude should be loaded into Atmel Studio (they reference v 6.2) as an external tool, but they all reference the use of the old COMM ports - which I don't have. I just downloaded version 6.3 of AVRdude. In the config file it says that it supports USB ports but that's as far as I've been able to get. No success in getting communication setup between SAS7 and the Mega board. I did find a little exe "USB View" that provided detailed information about what was connected to each USB port, but I have no idea how to use that information.
I have no problem purchasing a programmer if it works. Is there a recommendation for a programmer?
I've seen several posts/issue reports from users who were fooled by the ICE programmers included with the Arduino SAMD Boards into thinking they could use them with AVR. They were very disappointed to hear this couldn't be done without updating the avrdude version and adding a programmers.txt entry for the ICE. So I think there would be interest in this. It would be great if you could install the whole package via Boards Manager and I would be willing to have a try at that part of the project if you want.
Upload is working, but not burn bootloader. There seems to be an issue with writing lock bits.
Here is the error.
Writing | ################################################## | 100% 0.02s
avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:
Reading | ################################################## | 100% 0.01s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xff != 0x3f
avrdude: verification error; content mismatch
avrdude done. Thank you.
I was also able to debug an UNO with AR7, but I had to cut the auto reset, otherwise communication via debugWire is not possible. I guess its the same on the Mega.
For a while this post has been idle, but I can see that there is interest, so here is an update.
I was able to get avrdude 6.3 to talk to the ICE in Windows, using libusb, following the valuable instructions in THIS post.
In avrdude, once it sees the ICE, you will need to specify the programmer as -c atmelice_isp
I was able to read fuses from an m328p and an m1284p, so there is some light at the end of the tunnel.
@pert, it would be great if you could do that.
I don't mind doing the leg work and gathering info, but I am not able to do anything for the boards manager.
Here is a (sort of) working entry in programmers.txt:
Glad to hear you're making progress! I have already successfully used Boards Manager to install a custom programmer and am happy to do the same for this process. If you think you'll be able to find a solution to the problem with Burn Bootloader I think it would be best to wait for adding Boards Manager support but I'm ready to get started whenever. Have you tried running the avrdude commands for Burn Bootloader manually from the command line to check if the lock bits issue is specific to the IDE?
Locks bits:
0x0F converts 0xCF with the two MSB unprogrammed (1)
0x3F converts to 0xFF
Extended fuse:
0x05 converts to 0xFD with the five MSB unprogrammed (1)
So my new entry in boards.txt (based on the one for Uno) has this:
That's great you found the problem. It's unfortunate that it requires duplicate Board menu entries to work but it's better than nothing. I just had a look through the AVRDUDE manual hoping to find a setting that would get around this but nothing jumped out at me. So I'm starting to look into implementing the Boards Manager installation. This will consist of:
boards.txt with all standard Arduino AVR boards with modified fuse values
programmers.txt with the ICE entry
AVRDUDE 6.3
libusb driver?
So my immediate question is about the driver. Is is necessary to include a driver for the ICE? I'd like to try to make this automatically install via the post-install.bat file. I apologize in advance if I ask some dumb questions in the pursuit of this. I do have quite a bit of experience with Boards Manager(though this is the first time using tools and drivers) but I don't own an ICE so I'm at a bit of a disadvantage here.
somedude:
I was able to get avrdude 6.3 to talk to the ICE in Windows, using libusb, following the valuable instructions in THIS post.
From reading that thread it appears that step is only necessary if you have the Jungo driver installed for Atmel Studio. Is that correct?
pert:
From reading that thread it appears that step is only necessary if you have the Jungo driver installed for Atmel Studio. Is that correct?
Sorry I took so long to reply.
I will try to figure it out, my machine already has Atmel Studio installed, so I can't tell.
I would have to try it on another PC and I will report back.
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xff != 0x3f
avrdude: verification error; content mismatch
avrdude done. Thank you.
I was also able to debug an UNO with AR7, but I had to cut the auto reset, otherwise communication via debugWire is not possible. I guess its the same on the Mega.
To debug the Mega (and Leonardo) you need to enable the JTAGEN fuse through ICSP. This reduces the available analog pins by 4.
Excuse me, I'm trying to add the Atmel-Ice in the Arduino IDE 1.8.0 with avrdude 6.3 of windows7 but I can not ...
I modified the programmers.txt file with this:
Excuse me, I'm trying to add the Atmel-Ice in the Arduino IDE 1.8.0 with avrdude 6.3 of windows7 but I catmel_ice.name=Atmel-ICE (AVR)
atmel_ice.communication=usb
atmel_ice.protocol=atmelice_isp
atmel_ice.program.protocol=atmelice_isp
atmel_ice.program.tool=avrdude
atmel_ice.program.extra_params=-Pusb
But it does not work...
I keep getting this error:
avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\Simone\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino8/etc/avrdude.conf"
Using Port : COM1
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x48
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x48
My IDE is now set up with all the stuff I need, libraries, programmers, boards.
Since I never used AS, I thought sticking to a familiar environment would be ideal.
Plus, others would benefit from it too.
jremington:
Yes.
With clean installed Arduino IDE yes. If you use alternative / other boards and you use internal Atmel Studio Arduino import, your settings crash Atmel Studio or you get zero long error. With Visual Micro works all without problems.