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
Hot Topic (More than 8 Replies) Avr Isp mkii programming fails (Read 7074 times)
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Avr Isp mkii programming fails
Mar 3rd, 2018 at 10:55am
Print Post  
Hi
I am using an AVR ISP MKII to program a ATTINY 44. The chip programs correctly if I use Avrdudess but fails in Visual Studio 2012

Code (C++)
Select All
Compiling 'SentryPost' for 'ATtiny24/44/84 w/ ATtiny44'
Program size: 1 534 bytes (used 37% of a 4 096 byte maximum) (4.30 secs)
Minimum Memory Usage: 204 bytes (80% of a 256 byte maximum)

Uploading 'SentryPost' to 'ATtiny24/44/84 w/ ATtiny44' using 'avrispmkii'
	The upload process has finished.
avrdude: safemode: Verify error - unable to read hfuse properly. Programmer may not be reliable.

 



Any ideas please?
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Avr Isp mkii programming fails
Reply #1 - Mar 3rd, 2018 at 1:37pm
Print Post  
Check the usb driver. If you have installed atmel studio it will have killed it and replaced it with jungo driver. In that case you have two options.

Either reinstall the driver using the manufacturers cd that came with programmer or use libusb to add a new driver

Or

Use atmel studio. In atmel studio set the visual micro programmer to "Atmel Device Programming" then visual micro will envoke the atmel project tool for uploads.

if none of the above apply then switch on vmicro>uploader>verbose so we can see more info
  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Avr Isp mkii programming fails
Reply #2 - Mar 4th, 2018 at 10:20am
Print Post  
Hi Tim

I have not installed Atmel Studio and I will not do so either. I tried twice before and on two machines and bothe times it destroyed my VS2012 installation. Took me weeks to recover.

The programmer works perfectly outside of VS.

This result from within VS 
Code
Select All

This result from running Avrdude via Avrdudess.
[code c++]
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9207
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "C:\Arduino_Workspace\arduino\SentryPost\Release\SentryPost.hex"
avrdude.exe: input file C:\Arduino_Workspace\arduino\SentryPost\Release\SentryPost.hex auto detected as Intel Hex
avrdude.exe: writing flash (2974 bytes):

Writing | ################################################## | 100% 1.04s

avrdude.exe: 2974 bytes of flash written
avrdude.exe: verifying flash memory against C:\Arduino_Workspace\arduino\SentryPost\Release\SentryPost.hex:
avrdude.exe: load data flash data from input file C:\Arduino_Workspace\arduino\SentryPost\Release\SentryPost.hex:
avrdude.exe: input file C:\Arduino_Workspace\arduino\SentryPost\Release\SentryPost.hex auto detected as Intel Hex
avrdude.exe: input file C:\Arduino_Workspace\arduino\SentryPost\Release\SentryPost.hex contains 2974 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 0.90s

avrdude.exe: verifying ...
avrdude.exe: 2974 bytes of flash verified

avrdude.exe done.  Thank you.
 

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


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Avr Isp mkii programming fails
Reply #3 - Mar 4th, 2018 at 12:02pm
Print Post  
Okay what location is the avrdude you are testing with and what is the command line?
  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Avr Isp mkii programming fails
Reply #4 - Mar 4th, 2018 at 12:54pm
Print Post  
I only have one AvrDude installed and that is what comes when Arduino is installed.

The command line is this :  -c avrispmkII -p t44 -U flash:w:"C:\Arduino_Workspace\arduino\SentryPost\Release\SentryPost.hex":a
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Avr Isp mkii programming fails
Reply #5 - Mar 4th, 2018 at 12:57pm
Print Post  
You have also installed it via board manager which is why visual micro is using that one.

If you delete the downloaded avr tools visual micro will use the one with the arduino ide

Delete >>> C:\Users\mariusl\AppData\Local\arduino15\packages\arduino\tools\avrdude

You might try deleting the entire arduino package the just reinstall sam/samd or whatever is not supplied with arduino ide. Otherwise you install via board manager and it becomes out of date very easily for avr best to always use the one installed with the arduino ide
  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Avr Isp mkii programming fails
Reply #6 - Mar 4th, 2018 at 3:12pm
Print Post  
It worked on the first attempt after restarting VS. Second time it fails again. I noted that AvrDudess uses a local version of AvrDude 6.1. VM is using the installed one which is at version 6.3.

Code (C++)
Select All
Uploading 'SentryPost' to 'ATtiny24/44/84 w/ ATtiny44' using 'avrispmkii'
Uploader started for board ATtiny24/44/84 w/ ATtiny44
Uploader will use programmer name: avrispmkii
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude "-CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -V -pattiny44 -cstk500v2 -Pusb X4_attiny44\Release/SentryPost.ino.hex:i"
avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch
         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
         Using Port                    : usb
         Using Programmer              : stk500v2
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200055146
         AVR Part                      : ATtiny44
         Chip Erase delay              : 4500 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         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     6     4    0 no        256    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      4096   64     64  4500  4500 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
         Programmer Type : STK500V2
         Description     : Atmel STK500 Version 2.x firmware
         Programmer Model: AVRISP mkII
         Hardware Version: 1
         Firmware Version Master : 1.13
         Vtarget         : 5.0 V
         SCK period      : 8.00 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9207 (probably t44)
avrdude: safemode: hfuse reads as D4
avrdude: safemode: efuse reads as FF
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 4\Release/SentryPost.ino.hex"
avrdude: writing flash (2974 bytes):
Writing | ################################################## | 100% 1.08s
avrdude: 2974 bytes of flash written
avrdude: safemode: hfuse reads as FF
avrdude: safemode: efuse reads as FF
avrdude: safemode: lfuse changed! Was e2, and is now ff
Error during upload using programmer
Upload timed out waiting for a response

The uploader process failed 

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


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Avr Isp mkii programming fails
Reply #7 - Mar 4th, 2018 at 4:58pm
Print Post  
Try n older arduino ide. Which version are you using?

  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Avr Isp mkii programming fails
Reply #8 - Mar 5th, 2018 at 7:19am
Print Post  
I use version 1.8.3.
It compiles and loads in the Arduino IDE repeatedly but only once in VS. Then after that the programmer does not read the fuses correctly after verifying the flash. Almost like the process get stuck there.

The Arduino IDE does not read the fuses afterwards and programs every time. 

Code (C++)
Select All
avrdude: 2952 bytes of flash written
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as FF
avrdude: safemode: efuse reads as FF
avrdude: safemode: lfuse changed! Was e2, and is now ff
Error during upload using programmer
Upload timed out waiting for a response 



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


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Avr Isp mkii programming fails
Reply #9 - Mar 5th, 2018 at 2:05pm
Print Post  
Thanks for the info.

Please switch on vmicro>compiler>verbose and then upload and post the output as .txt

Also do same in arduino ide file>preferences>verbose upload and post the output.

Thanks
  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Avr Isp mkii programming fails
Reply #10 - Mar 5th, 2018 at 5:17pm
Print Post  
Files attached Tim
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Avr Isp mkii programming fails
Reply #11 - Mar 6th, 2018 at 4:03pm
Print Post  
Thanks.

I think I see the problem. You have installed arduino avr tool chain 1.6.21 via board manager but visual micro still compiles the one from your arduino ide\hardware folder. Furthermore visual micro uses the avr compiler installed via board manager yet the avrdude installed below the arduino ide.

If you delete this folder you should be left with a clean avr install, ( the one that installs with your chosen arduino ide version. At least it's one thing to remeber to update instead of two) .

C:\Users\mariusl\AppData\Local\Arduino15\packages\arduino

I will look into a fix for this situation because it must be quite common but it will take a week or so.

As an alternative the NO IDE option in visual micro will ignore your local arduino ide hardware folder. note: This will also ignore core arduino \libraries from below the ide in which case copy them to documents\arduino\libraries.


...

You have a board manager installed avrdude tool chain in "C:\Users\mariusl\AppData\Local\Arduino15\packages\arduino\tools\avrdude" which the arduino ide is using.

Code
Select All

But Visual Micro is using the one from the arduino ide folder.
[code c++]
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude "-CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -V -pattiny44 -cstk500v2 -Pusb X4_attiny44\Release/SentryPost.ino.hex:i"
 



  
Back to top
WWW  
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Avr Isp mkii programming fails
Reply #12 - Mar 6th, 2018 at 4:24pm
Print Post  
Thanks Tim. The second option did not work and when I removed the package installed version it failed asking for that file in the packages directory.

I will load external for now and wait for your fix as I cannot delete the packages installed directory as there are many other devices that need that. SAMD for one and the STM32 stuff as well.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12070
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Avr Isp mkii programming fails
Reply #13 - Mar 6th, 2018 at 4:57pm
Print Post  
Ok.

You could just delete the avr from hardware and from tools leaving sam etc untouched.

or use the "No Ide" option on tool bar
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint