AVR-ISP-MK2 avrdude problem...

Started by arsieroluca, October 25, 2013, 01:13:14 PM

Previous topic - Next topic

arsieroluca

Hi all,

I recently start to use this programmer with my arduino board.

I use ICSP with adapter to connect MK2 with 6 pins connector and my mk2 doesn't provide any power supplies (this is right because I have configured jumpers in that way).

I use avrdude on windows 7 64bit with olimex driver provided (I take these from olimex web site )
I use avrdude with this command line:
--> avrdude -p m328p -P usb -c avrispmkii -e -U flash:w:ATmegaBOOT_168_atmega328.hex -vvvv

and this have a particular behavior.
Have someone any idea about this issue?

Below the output of avrdude command.

Thanks a lot

avrdude: Version 6.0.1, compiled on Sep 18 2013 at 08:20:41
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Users\ghezza_dbu-mi\Desktop\avrdude\avrdude.conf"

         Using Port                    : usb
         Using Programmer              : avrispmkii
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200212345
avrdude: Sent: . [01]
^C
C:\Users\ghezza_dbu-mi\Desktop\avrdude>avrdude -p m328p -P usb -c avrispmkii -e -U flash:w:ATmegaBOOT_168_atmega328.hex
-vvvv

avrdude: Version 6.0.1, compiled on Sep 18 2013 at 08:20:41
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Users\ghezza_dbu-mi\Desktop\avrdude\avrdude.conf"

         Using Port                    : usb
         Using Programmer              : avrispmkii
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200212345
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: stk500v2_getsync(): timeout communicating with programmer
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
avrdude: Sent: . [03] . [90]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] timeout error

avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: Sent: . [03] . [90]
^C

LubOlimex

Hello there,

Can you provide me with a picture of your setup (board and programmer connected)? You can upload it to an image hosting web-site and link it here.

I suppose you are not using proper 10pin ICSP to 6pin ICSP adapter cable as explained in the user's manual. AVR-ISP-MK2 has only 10-pin ICSP (no 6-pin ICSP, the 6-pin connectors are TPI, PDI interfaces not ICSP). But this is just a blind guess.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

arsieroluca

Thanks a lot for your support.

At the moment I use the same adapter that olimex provided (ICSP 10 pin to 6-pin cable) so I use ICSP connector.

I also tried to change USB connection and I observe that behaviour change:
- if I doesn't connect my mk2 to the target the behaviour is the same of my first post.
- if I connect mk2 in some USB than avrdude say:
avrdude: Version 6.0.1, compiled on Sep 18 2013 at 08:20:41
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Users\ghezza_dbu-mi\Desktop\avrdude\avrdude.conf"

         Using Port                    : usb
         Using Programmer              : avrispmkII
         Overriding Baud Rate          : 115200
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200212345
avrdude: Sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): libusb0-dll:err [_usb_reap_async] reaping request failed, win error: Un dispositivo collegato al sistema non Þ in funzione.


avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_send(): wrote -5 out of 1 bytes, err = libusb0-dll:err [_usb_reap_async] reaping request failed, win error: Un dispositivo collegato al sistema non Þ in funzione.


avrdude: stk500_send_mk2(): failed to send command to serial port







Quote from: LubOlimex on October 25, 2013, 02:26:35 PM
Hello there,

Can you provide me with a picture of your setup (board and programmer connected)? You can upload it to an image hosting web-site and link it here.

I suppose you are not using proper 10pin ICSP to 6pin ICSP adapter cable as explained in the user's manual. AVR-ISP-MK2 has only 10-pin ICSP (no 6-pin ICSP, the 6-pin connectors are TPI, PDI interfaces not ICSP). But this is just a blind guess.

Best regards,
Lub/OLIMEX

arsieroluca

Hi Lub,

I tried also with avrstudio 4 (and right fw in mk2).

In this way the mk2 work fine.

Have you any idea or experience in my wrong behaviour with avrdude?
I wanna use this instead of AVR Studio...

Thanks a lot

arsieroluca

...I also tried other combination of fw/driver and I have some question...

- I put the "avr studio" fw inside mk2 and I tried to use it with avrdude (and libusb win driver): not working
- I put the "avrdude" fw inside mk2 and I tried to use it with avr studio (and jungo driver): It working!!!

this I was very surprised ... is a normal thing? I used the downloaded firmware package from olimex, you could get me a link to fw correct?

LubOlimex

Hey mate,

All files needed are here: https://www.olimex.com/Products/AVR/Programmers/AVR-ISP-MK2/resources/AVR-ISP-MK2-Firmware-WindowsDrivers.zip (except for Atmel FLIP software that has to be downloaded from Atmel's web site).

My advice is to be very diligent in the driver un-installation. Windows tends to auto-download drivers by default - make sure auto-driver downloads are disabled. Windows tends to store back-up drivers locally - make sure those are deleted before attempting driver update.

Every step in the manual has been tested multiple times. Please refer to the instructions

Remember that FOR AVRDUDE in step 5 you need to use libUSB-AVRISP-MKII.hex and in step 9 you need to use the libUSB drivers.

There are instructions how to run Arduino IDE with the MK2 and also demo code below that part (if you wish to use command line and ATmega16):

avrdude -p m16 -c avrispmkII -P usb -b 115200

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

arsieroluca

Hi!!!

Now I understand :)!!
In my many attempts I have doing some mistake. Fortune for the two fw the LED light up in different way :).

Now from command line I'm able to check MK2 and program the target! Great!!
I'm using avrdude from "arduino" path.
The only issue appear if I use bootloader program from Arduino software.

When I use this command from command line it work fine:
--> avrdude -p m328p -c avrispmkII -Pusb -U flash:w:C:\Elettronica\arduino\hardware\arduino\avr\bootloaders\optiboot\optiboot_atmega328.hex:i -U lock:w:0x0F:m

I don't understand but when I execute this operation it tell me (with verbose enabled ;)):

C:\Elettronica\arduino/hardware/tools/avr/bin/avrdude -CC:\Elettronica\arduino/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v2 -Pusb -Uflash:w:C:\Elettronica\arduino/hardware/arduino/avr/bootloaders/optiboot/optiboot_atmega328.hex:i -Ulock:w:0x0F:m

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch
         System wide configuration file is "C:\Elettronica\arduino/hardware/tools/avr/etc/avrdude.conf"
         Using Port                    : usb
         Using Programmer              : stk500v2
avrdude: usbdev_open(): did not find any USB device "usb"

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

Thanks a lot!!!


LubOlimex

Hello arsieroluca,

This is a common error message in Arduino - unfortunately it is not very informative and might pop due to a number of reasons. There are a lot of discussions and solutions about it in the official Arduino forums - for instance: http://forum.arduino.cc/index.php?topic=150690.0

The simplest error that might have occured is if you have selected wrong programmer in Tools->Programmer. Make sure it is AVRISP mkII.

Also make few tries with manual board reset as mentioned in the manual:

QuoteSpecial mention for Olimex boards – sometimes the board refuses to reset before programming
when using Arduino. Try holding the reset button and release it simultaneously while clicking
"Upload Using Programmer".


Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex