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 avrdude & Dragon in cmd line, Arduino IDE, and Atmel or Visual Studio (Read 585 times)
PStechPaul
Junior Member
**
Offline


Posts: 33
Joined: Mar 25th, 2016
avrdude & Dragon in cmd line, Arduino IDE, and Atmel or Visual Studio
Apr 4th, 2016 at 12:15am
Print Post  
I've been having problems with using the AVR Dragon ISP from anything other than the Atmel Studio 7.0, which most likely does not use avrdude. So I'm trying to resolve this problem by running avrdude from the command line using a batch file for convenience. I have the latest Arduino IDE 1.6.8 installed and working using the Arduino (Pro Mini) as ISP.

When I add AVR Dragon to the programmers.conf file, and choose it from the list and try "upload using programmer", I get the following error:

Code
Select All
avrdude: usbdev_open(): did not find any USB device "usb" 



Searching for this error I found the following:
https://forum.arduino.cc/index.php?topic=316037.0

It suggests that avrdude 6.0 has a bug, and recommends 6.1 from http://download.savannah.gnu.org/releases/avrdude/avrdude-6.1-mingw32.zip

I have that, and I replaced the older version in the 1.6.8 folder with the newer version. I also changed the programmers.txt with the AVR Dragon definition, but the system-wide path seems to be C:\WinAVR-20100110\bin, and I updated it there as well. It also has a libusb0.dll that is older and smaller, but in the IDE it is newer and larger. I don't know which one is actually used, and I left them alone. The various versions are here:
Code
Select All
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin
C:\WinAVR-20100110\bin 



I have added the following definition to programmers.txt:

Code
Select All
#added 4/2/16 PES
avr_dragon.name=AVR Dragon
avr_dragon.communication=usb
avr_dragon.protocol=dragon_isp
avr_dragon.program.protocol=dragon_isp
avr_dragon.program.tool=avrdude
avr_dragon.program.extra_params=-Pusb 



When I run the batch file, I get the following results:
Code
Select All
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin>pause
Press any key to continue . . .

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin>avrdude
Usage: avrdude [options]
Options:
  -p <partno>                Required. Specify AVR device.
  -b <baudrate>              Override RS-232 baud rate.
  -B <bitclock>              Specify JTAG/STK500v2 bit clock period (us).
  -C <config-file>           Specify location of configuration file.
  -c <programmer>            Specify programmer type.
  -D                         Disable auto erase for flash memory
  -i <delay>                 ISP Clock Delay [in microseconds]
  -P <port>                  Specify connection port.
  -F                         Override invalid signature check.
  -e                         Perform a chip erase.
  -O                         Perform RC oscillator calibration (see AVR053).
  -U <memtype>:r|w|v:<filename>[:format]
                             Memory operation specification.
                             Multiple -U options are allowed, each request
                             is performed in the order specified.
  -n                         Do not write anything to the device.
  -V                         Do not verify.
  -u                         Disable safemode, default when running from a scrip
t.
  -s                         Silent safemode operation, will not ask you if
                             fuses should be changed back.
  -t                         Enter terminal mode.
  -E <exitspec>[,<exitspec>] List programmer exit specifications.
  -x <extended_param>        Pass <extended_param> to programmer.
  -y                         Count # erase cycles in EEPROM.
  -Y <number>                Initialize erase cycle # in EEPROM.
  -v                         Verbose output. -v -v for more.
  -q                         Quell progress output. -q -q for less.
  -l logfile                 Use logfile rather than stderr for diagnostics.
  -?                         Display this usage.

avrdude version 6.1, URL: <http://savannah.nongnu.org/projects/avrdude/>

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin>pause
Press any key to continue . . .

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin>avrdude -v -v -v -v -c dra
gon_isp -p m328 -P usb

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:\WinAVR-20100110\bin\avrdude.conf"


         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: stk500v2_dragon_isp_open()
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2107)

avrdude done.  Thank you.


C:\Program Files (x86)\Arduino\hardware\tools\avr\bin>pause
Press any key to continue . . . 



Running the IDE again I get a slightly different error message:
Code
Select All
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2107) 



That matches the hardware IDs for the Jungo Dragon as seen in Device Manager:
Code
Select All
USB\VID_03EB&PID_2107&REV_0100
USB\VID_03EB&PID_2107
 



That's enough for now. Let me know if there is anything else to try. Thanks!  Cool
« Last Edit: Apr 4th, 2016 at 12:31am by PStechPaul »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: avrdude & Dragon in cmd line, Arduino IDE, and Atmel or Visual Studio
Reply #1 - Apr 4th, 2016 at 11:09am
Print Post  
Often there is confusion between the usb drivers that atmel studio installs and the ones that avrdude uses.

What is the usb driver that device manager shows as being used by the dragon?

If the driver shows as Jungo then it is probably the problem.

This is another reason why I don't recommend installing atmel studio Smiley I have no idea why atmel would let this confusion happen to their arduino base.

If I am right then this page might help http://www.visualmicro.com/post/2014/01/17/AvrIsp-MkII-Usb-Driver-for-Arduino.as...


Please remember these are standard tools so the Arduino and other forums will also help. I found this similar article with similar solution http://www.avrfreaks.net/forum/avr-dragon-avrdude-need-correct-port
« Last Edit: Apr 4th, 2016 at 11:15am by Tim@Visual Micro »  
Back to top
IP Logged
 
PStechPaul
Junior Member
**
Offline


Posts: 33
Joined: Mar 25th, 2016
Re: avrdude & Dragon in cmd line, Arduino IDE, and Atmel or Visual Studio
Reply #2 - Apr 4th, 2016 at 9:08pm
Print Post  
That is good information, and probably can be used to get things working properly. But it is rather confusing and tedious, so I think for now I will just accept the limitations and proceed with what I really need to do. That is to build an Arduino sketch that can be edited with the Arduino IDE and uploaded to the board using the normal means with the FTDI device. This is so that people with the existing EV charger can replace the buggy sketch they are now using, with a better user interface, and eventually also replace the ugly PCBs now being used with a much improved design that I am working on.

For more information on this project, you can visit the forum where I discuss my involvement with the charger, which is a DIY 10-12 kW battery pack charger for EVs. It has gone through many revisions, with lots of poorly documented "fixes" and "patches" to the hardware and software, and is poorly supported by the developer:

http://www.diyelectriccar.com/forums/showthread.php/10kw-60a-diy-charger-open-so...

Another thread is here, which documents my efforts to provide an upgrade for these chargers:

http://www.diyelectriccar.com/forums/showthread.php/analyzing-troubleshooting-fi...

My ultimate preference would be to use a Microchip PIC instead of an AVR device or Arduino board. I have been using Microchip devices for perhaps 15 years and I am more comfortable with their architecture and software framework, and their debugger/programming tools. I like their software simulator which is very powerful and effective. Atmel also has a similar simulator that I would like to be able to use, but so far I've only been able to do so for simple C projects for the Arduino or ATMega328P. 

I think it would be helpful if you could add some of the contents of this forum to the FAQs and maybe even put together an installation script that performs most of the tasks described here and elsewhere. Most people might find these instructions too confusing or dangerous to attempt.

Thanks  Cool
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: avrdude & Dragon in cmd line, Arduino IDE, and Atmel or Visual Studio
Reply #3 - Apr 4th, 2016 at 9:11pm
Print Post  
This Topic was moved here from General Board [move by] Visual Micro.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint