Olimex Support Forum

Microcontrollers => AVR => Topic started by: Evgen007_nsk on June 23, 2017, 01:41:40 PM

Title: (AVR-ISP-MK2) firmware can't be done on microcontroller
Post by: Evgen007_nsk on June 23, 2017, 01:41:40 PM
I use the programmer AVR-ISP-MK2, the operating system Windows 7 64bit. The version of the driver is 1.2.6.0. I can't do firmware of the controller on the power board SPM45B-220, errors are output to the log. For some reason there is no connection with the programmer, although USB is working.

Quoteavrdude.exe: Version 6.3, compiled on Feb 17 2016 at 09:25:53
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2014 Joerg Wunsch

             System wide configuration file is "D:\SPM45B-factory-0x06\avrdude.c
onf"

             Using Port                    : usb
             Using Programmer              : avrispmkII
avrdude.exe: usbdev_open(): Found AVRISP mkII, serno: 000200312345
avrdude.exe: Sent: . [01]
avrdude.exe: usbdev_recv_frame(): usb_bulk_read():
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: Sent: . [01]
avrdude.exe: usbdev_recv_frame(): usb_bulk_read():
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: Sent: . [01]
avrdude.exe: usbdev_recv_frame(): usb_bulk_read():
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: Sent: . [01]
avrdude.exe: usbdev_recv_frame(): usb_bulk_read():
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: Sent: . [01]
avrdude.exe: usbdev_recv_frame(): usb_bulk_read():
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: Sent: . [01]
avrdude.exe: usbdev_recv_frame(): usb_bulk_read():
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: stk500v2_getsync(): timeout communicating with programmer
             AVR Part                      : ATtiny40
             Chip Erase delay              : 0 us
             PAGEL                         : P00
             BS2                           : P00
             RESET disposition             : dedicated
             RETRY pulse                   : SCK
             serial program mode           : yes
             parallel program mode         : yes
             Timeout                       : 0
             StabDelay                     : 0
             CmdexeDelay                   : 0
             SyncLoops                     : 0
             ByteDelay                     : 0
             PollIndex                     : 0
             PollValue                     : 0x00
             Memory Detail                 :

                                      Block Poll               Page
          Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ -----
----- ---------
               signature      0     0     0    0 no          3   16      0     0
     0 0x00 0x00
                                      Block Poll               Page
          Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ -----
----- ---------
               fuse           0     0     4    0 no        @ECHO OFF
avrdude.exe -c avrispmkII -p t40 -U flash:w:spm45b-220x12.hex:a
pause  1   16      0     0
     0 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   16      0     0
     0 0x00 0x00
                                      Block Poll               Page
          Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ -----
----- ---------
               lockbits       0     0     0    0 no          1   16      0     0
     0 0x00 0x00
                                      Block Poll               Page
          Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ -----
----- ---------
               flash          0     0   128    0 no       4096   64      0     0
     0 0x00 0x00

             Programmer Type : STK500V2
             Description     : Atmel AVR ISP mkII
             Programmer Model: AVRISP mkII
avrdude.exe: Sent: . [03] . [90]
avrdude.exe: usbdev_recv_frame(): usb_bulk_read():
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: Sent: . [01]
avrdude.exe: usbdev_recv_frame(): usb_bulk_read():
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: Sent: . [01]
avrdude.exe: usbdev_recv_frame(): usb_bulk_read():
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: Sent: . [01]
avrdude.exe: usbdev_recv_frame(): usb_bulk_read():
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: Sent: . [01]
avrdude.exe: usbdev_recv_frame(): usb_bulk_read():
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: Sent: . [01]

Directly used script:

Quote@ECHO OFF
avrdude.exe -c avrispmkII -p t40 -U flash:w:spm45b-220x12.hex:a
pause

I use the TPI interface on the programmer.
Thank you.
Title: Re: (AVR-ISP-MK2) firmware can't be done on microcontroller
Post by: LubOlimex on June 26, 2017, 10:59:57 AM
Can you try AVRDUDE version prior to 6.x.x (e.g. 1.5.7)?

I believe this is related to the bug described at the last question in the FAQ section at AVR-ISP-MK2's product page. Quote:

QuoteI have performed a firmware switch. My drivers are properly installed. Still I can't properly program my target with AVRDUDE. I also tested with the latest Arduino IDE. What is the problem? Is my programmer bricked?

The hardware of your AVR-ISP-MK2 is fine. There is a software bug that affects LUFA-based programmers in newest releases of AVRDUDE. Either use AVRDUDE versions prior to 6.x.x or apply this patch to the AVRDUDE sources and compile.

The same problems appears in newest releases of Arduino IDE – they use AVRDUDE versions 6.0.1 or newer. The last suitable Arduino IDE version that uses pre-6.x.x AVRDUDE version is Arduino IDE 1.5.7.

The official bug report is here: https://savannah.nongnu.org/bugs/index.php?40831

More about the issue can be found here: http://www.avrfreaks.net/forum/lufa-based-avrisp-mkii-doesnt-work-avrdude-601

Best regards,
Lub/OLIMEX
Title: Re: (AVR-ISP-MK2) firmware can't be done on microcontroller
Post by: Evgen007_nsk on June 27, 2017, 05:34:18 AM
QuoteCan you try AVRDUDE version prior to 6.x.x (e.g. 1.5.7)?

Good afternoon. Can you please tell me where you can download the software version 1.5.7? Can I get a link?

Thank you.
Title: Re: (AVR-ISP-MK2) firmware can't be done on microcontroller
Post by: LubOlimex on June 30, 2017, 11:41:08 AM
Test with this 5.11 version: http://download.savannah.gnu.org/releases/avrdude/avrdude-5.11-Patch7610-win32.zip

Older releases can be found here: http://download.savannah.gnu.org/releases/avrdude/

Best regards,
Lub/OLIMEX
Title: Re: (AVR-ISP-MK2) firmware can't be done on microcontroller
Post by: Slimfy1 on April 01, 2019, 10:38:58 AM
Try this:
https://github.com/slimfy1/Olimex-Avrdude6_patch