Olimex Support Forum

Microcontrollers => AVR => Topic started by: rockwell1799 on May 06, 2023, 11:52:37 PM

Title: Intermittant problem with AVRISP MK2!
Post by: rockwell1799 on May 06, 2023, 11:52:37 PM
Hello
I have a very annoying problem with my OLIMEX AVRISP MK2, which I'm using with Atmel studio 7, I'm having issue to program the chip (Atmega328P) and the only solution I have is to shut ATmel studio down and try again then it works. I'm using the libusb-win32 driver!
I have a cheap USBtiny program and never had an issue with it!
Furthermore, I have attached the error I'm getting below:
Can you please guide me how to fix the issue?

avrdude: Version 7.1
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is C:\avrdude-v7.1-windows-x64\avrdude.conf

         Using Port                    : usb
         Using Programmer              : avrispmkii
avrdude: usbdev_open(): found AVRISP mkII, serno: 000200212345
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

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

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 0
         Serial number   : 000200212345
         Firmware Version Controller : 1.41
         Vtarget         : 3.3 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e950f (probably m328p)
avrdude: Note: flash memory has been specified, an erase cycle will be performed.
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file E:\Electronics_projects\Atmel_studio\nokia-demo-atmega328p-new-int0-joystick\nokia-demo-atmega328p\Debug\nokia-demo-atmega328p.hex for flash
         with 1738 bytes in 1 section within [0, 0x6c9]
         using 14 pages and 54 pad bytes
avrdude: writing 1738 bytes flash ...

Writing | #####################----------------------------- | 42% 0.27s

avrdude stk500v2_recv_mk2() error: unable to receive from USB
avrdude usbdev_send() error: wrote -5 out of 1 bytes, err = No error
avrdude stk500v2_send_mk2() error: unable to send command to serial port
Title: Re: Intermittant problem with AVRISP MK2!
Post by: LubOlimex on May 08, 2023, 12:01:25 PM
First time I hear about that issue, but why have you pasted avrdude log if your problem is with Atmel Studio 7. I don't understand.
Title: Re: Intermittant problem with AVRISP MK2!
Post by: rockwell1799 on May 08, 2023, 10:38:45 PM
Sorry, it's my bad! I was using avrdude inside Atmel studio to program the chip. I didn't know that can I use the "Programming device" option to flash the MCU directly from there. Now, everything is working as expected. Thank you!
Title: Re: Intermittant problem with AVRISP MK2!
Post by: LubOlimex on May 09, 2023, 08:30:24 AM
Great, yes you can directly program from Atmel Studio 7! Glad it works well now!