Adding the Atmel-ICE to the Arduino IDE

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Am I correct in assuming that this would require a programmer entry into programmers.txt and avrdude having support for the Atmel-ICE.

 

Anybody know if that is in the works?

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just used "verbose" on the 1.0.6 distribution.

 

It uses avrdude-v5.11 so it will have no idea about atmel-ice

 

You would need to install avrdude-v6.1 into the Arduino directory.

And add ATMEL-ICE to the "programmers.txt"

 

The Arduino Releases generally use well-proven components.   e.g. elderly compiler, tools

So I would not expect it to appear very soon.   Perhaps westfw may have some inside knowledge.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

You would need to install avrdude-v6.1 into the Arduino directory.

And add ATMEL-ICE to the "programmers.txt"

I have avrdude-v6.1 in the Arduino directory.  avrdude.exe is at C:\Program Files (x86)\Arduino\hardware\tools\avr\bin and avrdude.conf is at C:\Program Files (x86)\Arduino\hardware\tools\avr\etc.  That step is done.

 

However, and there is always a however, this is the error message that I get from avrdude-v6.1:  (run from c:\avrdude\ - set in path)

C:\>avrdude -p m328p -c atmelice_isp -P usb  -v -v -v -v

avrdude: Version 6.1, compiled on Mar 13 2014 at 00:09:49
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\avrdude\avrdude.conf"

         Using Port                    : usb
         Using Programmer              : atmelice_isp
avrdude: stk500v2_jtag3_open()
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2141)
avrdude: jtag3_open_common(): Did not find any device matching VID 0x03eb and PID list: 0x2141

avrdude done.  Thank you.

Of course the Atmel-ICE device does exist on my system with a matching VID/PID.  (Listing courtesy of PowerShell 4.0*)

__GENUS                     : 2
__CLASS                     : Win32_PnPEntity
__SUPERCLASS                : CIM_LogicalDevice
__DYNASTY                   : CIM_ManagedSystemElement
__RELPATH                   : Win32_PnPEntity.DeviceID="USB\\VID_03EB&PID_2141\\J41800034427"
__PROPERTY_COUNT            : 24
__DERIVATION                : {CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER                    : WOULDNTYOULIKETOKNOW
__NAMESPACE                 : root\cimv2
__PATH                      : \\WOULDNTYOULIKETOKNOW\root\cimv2:Win32_PnPEntity.DeviceID="USB\\VID_03EB&PID_2141\\J41800034427"
Availability                : 
Caption                     : USB Composite Device
ClassGuid                   : {36fc9e60-c465-11cf-8056-444553540000}
CompatibleID                : {USB\DevClass_00&SubClass_00&Prot_00, USB\DevClass_00&SubClass_00, USB\DevClass_00, USB\COMPOSITE}
ConfigManagerErrorCode      : 0
ConfigManagerUserConfig     : False
CreationClassName           : Win32_PnPEntity
Description                 : USB Composite Device
DeviceID                    : USB\VID_03EB&PID_2141\J41800034427
ErrorCleared                : 
ErrorDescription            : 
HardwareID                  : {USB\VID_03EB&PID_2141&REV_0101, USB\VID_03EB&PID_2141}
InstallDate                 : 
LastErrorCode               : 
Manufacturer                : (Standard USB Host Controller)
Name                        : USB Composite Device
PNPDeviceID                 : USB\VID_03EB&PID_2141\J41800034427
PowerManagementCapabilities : 
PowerManagementSupported    : 
Service                     : usbccgp
Status                      : OK
StatusInfo                  : 
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : WOULDNTYOULIKETOKNOW
PSComputerName              : WOULDNTYOULIKETOKNOW

__GENUS                     : 2
__CLASS                     : Win32_PnPEntity
__SUPERCLASS                : CIM_LogicalDevice
__DYNASTY                   : CIM_ManagedSystemElement
__RELPATH                   : Win32_PnPEntity.DeviceID="USB\\VID_03EB&PID_2141&MI_00\\7&C584805&1&0000"
__PROPERTY_COUNT            : 24
__DERIVATION                : {CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER                    : WOULDNTYOULIKETOKNOW
__NAMESPACE                 : root\cimv2
__PATH                      : \\WOULDNTYOULIKETOKNOW\root\cimv2:Win32_PnPEntity.DeviceID="USB\\VID_03EB&PID_2141&MI_00\\7&C584805&1&0000"
Availability                : 
Caption                     : USB Input Device
ClassGuid                   : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
CompatibleID                : {USB\Class_03&SubClass_00&Prot_00, USB\Class_03&SubClass_00, USB\Class_03}
ConfigManagerErrorCode      : 0
ConfigManagerUserConfig     : False
CreationClassName           : Win32_PnPEntity
Description                 : USB Input Device
DeviceID                    : USB\VID_03EB&PID_2141&MI_00\7&C584805&1&0000
ErrorCleared                : 
ErrorDescription            : 
HardwareID                  : {USB\VID_03EB&PID_2141&REV_0101&MI_00, USB\VID_03EB&PID_2141&MI_00}
InstallDate                 : 
LastErrorCode               : 
Manufacturer                : (Standard system devices)
Name                        : USB Input Device
PNPDeviceID                 : USB\VID_03EB&PID_2141&MI_00\7&C584805&1&0000
PowerManagementCapabilities : 
PowerManagementSupported    : 
Service                     : HidUsb
Status                      : OK
StatusInfo                  : 
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : WOULDNTYOULIKETOKNOW
PSComputerName              : WOULDNTYOULIKETOKNOW

__GENUS                     : 2
__CLASS                     : Win32_PnPEntity
__SUPERCLASS                : CIM_LogicalDevice
__DYNASTY                   : CIM_ManagedSystemElement
__RELPATH                   : Win32_PnPEntity.DeviceID="HID\\VID_03EB&PID_2141&MI_00\\8&E751486&0&0000"
__PROPERTY_COUNT            : 24
__DERIVATION                : {CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER                    : WOULDNTYOULIKETOKNOW
__NAMESPACE                 : root\cimv2
__PATH                      : \\WOULDNTYOULIKETOKNOW\root\cimv2:Win32_PnPEntity.DeviceID="HID\\VID_03EB&PID_2141&MI_00\\8&E751486&0&0000"
Availability                : 
Caption                     : HID-compliant vendor-defined device
ClassGuid                   : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
CompatibleID                : 
ConfigManagerErrorCode      : 0
ConfigManagerUserConfig     : False
CreationClassName           : Win32_PnPEntity
Description                 : HID-compliant vendor-defined device
DeviceID                    : HID\VID_03EB&PID_2141&MI_00\8&E751486&0&0000
ErrorCleared                : 
ErrorDescription            : 
HardwareID                  : {HID\VID_03EB&PID_2141&REV_0101&MI_00, HID\VID_03EB&PID_2141&MI_00, HID_DEVICE_UP:FF00_U:0001, HID_DEVICE_UPR:FF00-FFFF...}
InstallDate                 : 
LastErrorCode               : 
Manufacturer                : (Standard system devices)
Name                        : HID-compliant vendor-defined device
PNPDeviceID                 : HID\VID_03EB&PID_2141&MI_00\8&E751486&0&0000
PowerManagementCapabilities : 
PowerManagementSupported    : 
Service                     : 
Status                      : OK
StatusInfo                  : 
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : WOULDNTYOULIKETOKNOW
PSComputerName              : WOULDNTYOULIKETOKNOW

__GENUS                     : 2
__CLASS                     : Win32_PnPEntity
__SUPERCLASS                : CIM_LogicalDevice
__DYNASTY                   : CIM_ManagedSystemElement
__RELPATH                   : Win32_PnPEntity.DeviceID="USB\\VID_03EB&PID_2141&MI_01\\7&C584805&1&0001"
__PROPERTY_COUNT            : 24
__DERIVATION                : {CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER                    : WOULDNTYOULIKETOKNOW
__NAMESPACE                 : root\cimv2
__PATH                      : \\WOULDNTYOULIKETOKNOW\root\cimv2:Win32_PnPEntity.DeviceID="USB\\VID_03EB&PID_2141&MI_01\\7&C584805&1&0001"
Availability                : 
Caption                     : Atmel-ICE Data Gateway
ClassGuid                   : {f7c441d4-a5d6-4087-bebb-7ee625ce7fd0}
CompatibleID                : {USB\Class_ff&SubClass_ff&Prot_ff, USB\Class_ff&SubClass_ff, USB\Class_ff}
ConfigManagerErrorCode      : 0
ConfigManagerUserConfig     : False
CreationClassName           : Win32_PnPEntity
Description                 : Atmel-ICE Data Gateway
DeviceID                    : USB\VID_03EB&PID_2141&MI_01\7&C584805&1&0001
ErrorCleared                : 
ErrorDescription            : 
HardwareID                  : {USB\VID_03EB&PID_2141&REV_0101&MI_01, USB\VID_03EB&PID_2141&MI_01}
InstallDate                 : 
LastErrorCode               : 
Manufacturer                : Atmel Corp.
Name                        : Atmel-ICE Data Gateway
PNPDeviceID                 : USB\VID_03EB&PID_2141&MI_01\7&C584805&1&0001
PowerManagementCapabilities : 
PowerManagementSupported    : 
Service                     : WinUSB
Status                      : OK
StatusInfo                  : 
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : WOULDNTYOULIKETOKNOW
PSComputerName              : WOULDNTYOULIKETOKNOW

Are we back to the same issue with avrdude needing a libusb compatible driver?  Can't avrdude be built with WinUSB?

 

Tried a libusb-win32 driver and got avrdude to recognize the Atmel-ICE but it hung with a different error message:

C:\>avrdude -p m328p -c atmelice_isp -v -v -v -v

avrdude: Version 6.1, compiled on Mar 13 2014 at 00:09:49
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\avrdude\avrdude.conf"

         Using Port                    : usb
         Using Programmer              : atmelice_isp
avrdude: stk500v2_jtag3_open()
avrdude: usbdev_open(): Found Atmel-ICE Data Gateway, serno: J41800034427
avrdude: jtag3_getsync()
avrdude: Sending sign-on command:
avrdude: jtag3_send(): sending 3 bytes
avrdude: usbdev_send(): wrote -22 out of 7 bytes, err =
avrdude: jtag3_send(): failed to send command to serial port
avrdude: jtag3_recv():
avrdude: usbdev_recv_frame(): usb_bulk_read():
avrdude: jtag3_recv(): Timeout receiving packet

avrdude: sign-on command: timeout/error communicating with programmer (status -1)
avrdude: failed to sync with the JTAGICE3 in ISP mode

avrdude done.  Thank you.

Any thoughts guys and girls?

 

* Powershell Get-USB function found at http://www.lazywinadmin.com/2011/06/powershell-get-usb.html:

function Get-USB {
    <#
    .Synopsis
        Gets USB devices attached to the system
    .Description
        Uses WMI to get the USB Devices attached to the system
    .Example
        Get-USB
    .Example
        Get-USB | Group-Object Manufacturer  
    .Parameter ComputerName
        The name of the computer to get the USB devices from
    #>
    param($computerName = "localhost")
    Get-WmiObject Win32_USBControllerDevice -ComputerName $ComputerName `
        -Impersonation Impersonate -Authentication PacketPrivacy | 
        Foreach-Object { [Wmi]$_.Dependent }
}

 

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Tue. Dec 30, 2014 - 08:37 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Arduino 1.5.x updates a lot of the tools (in particular, avr-gcc 4.8.x !) AND provides a much larger range of run-time configuration via "platforms.txt."

There is some description here: https://github.com/arduino/Ardui...

I haven't looked at it much, yet, but I'd urge that anyone contemplating "unusual" tool additions should use this, as part of a three-pronged attack:

1) I think it will be easier.

2) It will help debug the new IDE and its documentation.

3) It will encourage other people to use it as well, AND encourage users to make the switch.  (The number of users and 3rd party developers that are still using pre-1.0 based SW is depressing.)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw, thanks for the info on Arduino 1.5.x.  As soon as we get the avrdude/Atmel-ICE issue worked out then we can give 1.5.8 a try with it.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Tue. Dec 30, 2014 - 09:53 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think that with 1.5.8, you should be able to use some other command-line tool for driving the Atmel-ICE, and bypass the whole "AS requires different drivers than AVRDude" situation.  (Does atmel provide such a utility, or is it all GUI-based or AS-integrated?)

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:
I think that with 1.5.8, you should be able to use some other command-line tool for driving the Atmel-ICE, and bypass the whole "AS requires different drivers than AVRDude" situation.

I agree with the bypass suggestion.  To much of a hassle trying to get things to work with both AS and avrdude.

westfw wrote:
(Does atmel provide such a utility, or is it all GUI-based or AS-integrated?)

I just tried atprogram (atprogram.exe) and it worked standalone with the Atmel-ICE.  I guess I will have to read up on how to integrate it into Arduino 1.5.x.

 

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Tue. Dec 30, 2014 - 10:37 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can understand the requirement for ATMEL-ICE to install the Bootloader on an Arduino.

This is a one-off for most people.   So it seems relatively straightforward to write a .BAT file that uses atprogram.exe

 

I don't have an ATMEL-ICE.    I would assume that avrdude-6.1 would work just fine on Linux, Windoze or Mac.

 

Once the Bootloader is installed,   you can throw your ATMEL-ICE away (for Arduino purposes)

 

Yes,    I occasionally use debugWIRE with AS6.2 for non-Arduino projects.    Or even with C++ projects that use Arduino libraries.

At the end of the debugging phase,   I need to restore the Bootloader.    Either with a .BAT file or via the Arduino IDE.

 

Yes,   it would be nice if ATMEL-ICE worked with the Arduino IDE Bootloader install Tool.

Whether you use a .BAT or the IDE,   it is essential that you have the correct bootloader, fuses and lock.    Relying on manual installation is too risky.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

David, this thread is not about whether we need to use the Atmel-ICE or the Arduino bootloader for programming Arduinos.  We all know how nifty the Arduino bootloader is.  Being able to use the Arduino IDE with the Atmel-ICE is my goal.

Who uses .bat files anymore?cheeky

 

westfw,  I read up on how to add the tool to Arduino 1.5.x and I should be able to add the Atmel-ICE using atprogram quite easily.  I'll give it a shot in the morning.

 

Not having to perform voodoo tricks with the drivers just to satisfy avrdude is the best aspect of this approach.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

larryvc wrote:

Who uses .bat files anymore?

 

We do everyday to load hundreds of production units!

 

 

JC

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
We do everyday to load hundreds of production units!

I was being a bit sarcastic when I said that.  I still use them for a few tasks.

 

There are more modern alternatives.  I use powershell scripts to do the heavy lifting these days.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

Last Edited: Wed. Dec 31, 2014 - 03:06 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

larryvc wrote:

 

ki0bk wrote:

We do everyday to load hundreds of production units!

 

I was being a bit sarcastic when I said that.  I still use them for a few tasks.

 

There are more modern alternatives.  I use powershell scripts to do the heavy lifting these days.

A rose by any other name...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did anybody manage to integrate atprogram into the Arduino IDE?

 

I would have figured it's something like this:

 

atmelice.name=Atmel ICE

atmelice.program.tool=atprogram

atmelice.program.extra_params=-t atmelice -i ISP

 

But Arduino seems to ignore the program.tool and still tries to use avrdude.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can see it in the list of programmers, I selected it, but I get this error when trying to upload the sketch:
 

Arduino:1.8.2 (Windows 10), Scheda:"Arduino Due (Programming Port)"

Lo sketch usa 22124 byte (4%) dello spazio disponibile per i programmi. Il massimo è 524288 byte.
processing.app.debug.RunnerException: Seleziona un programmatore tramite il menù "Strumenti > Programmatore"
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingProgrammer(SerialUploader.java:317)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:89)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.SketchController.upload(SketchController.java:713)
at processing.app.SketchController.exportApplet(SketchController.java:686)
at processing.app.Editor$DefaultExportAppHandler.run(Editor.java:2232)
at java.lang.Thread.run(Thread.java:745)
Seleziona un programmatore tramite il menù "Strumenti > Programmatore"

 

  • Sorry for the Italian error message, it tells to select a Programmer, but of course I already selected it.
    Using Atmel Studio both the Uploading and the hardware debug work.
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You normally use the Serial Bootloader with a Due.

You can use JTAG if you connect to the JTAG header but I am not sure how Arduino would use it.

 

Personally,  I have connected via JTAG.   Then used AS7 or Keil for programming/debugging non-Arduino code.

 

For Arduino code,   I have used Arduino IDE to create the ELF file.   Then used AS7 or Rowley to "Open Object File for debugging"

This works nicely.  i.e. I can inspect classes, locals, memory, SFRs, ... in the actual executable that would run on a punter's Due.

 

I suspect that you can use "Upload using External Programmer" from the Arduino IDE.   Just like with a Zero.

Except that your ATMEL-ICE is external.  The ZERO has an EDBG chip on the pcb.   (and it is a lot quicker than the bootloader)

 

What do you really want to do?

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I always used the Usb bootloader, but now I have also a AtmelICE, and it loads the firmware much faster (I tested it in Atmel Studio).
I would like to be able to use AtmelICE as a programmer also with Arduino Ide, as:
- that option is included in Arduino Ide

- AtmelICE for sure works with Arduino Due (I tested it in Atmel Studio).

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
I suspect that you can use "Upload using External Programmer" from the Arduino IDE.   Just like with a Zero.

Except that your ATMEL-ICE is external.  The ZERO has an EDBG chip on the pcb.   (and it is a lot quicker than the bootloader)

That should work because Atmel-ICE's EDBG includes CMSIS-DAP and CMSIS-DAP is in OpenOCD.

 


http://www.atmel.com/webdoc/protocoldocs/ch01s01.html

http://openocd.org/doc-release/html/Debug-Adapter-Configuration.html#Interface-Drivers

https://sourceforge.net/p/openocd/tickets/68/

https://learn.adafruit.com/debugging-the-samd21-with-gdb/software-installation

http://docs.platformio.org/en/latest/platforms/atmelsam.html#packages

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

May be the problem is this:
Arduino Ide includes an ATMEL-ICE (AVR) programmer, but Arduino Due could require an ATMEL-ICE (SAM) programmer.