Go Down

Topic: Problem uploading sketches to attny85 on ubuntu and arduino IDE (Read 831 times) previous topic - next topic

MechEng87

Hello,
Having a problem with uploading a sketch to an ATtiny85 while using a Nano as the "Arduino as ISP".  This is only happening while using my Linux machine running Ubuntu 16.04.  I have a different machine running windows 10 and using the same Arduino IDE (V1.8.5 on both computers) and I can upload the same sketch (blink) with no problems.  I can upload sketches to the Nano from the Ubuntu machine just fine but am not sure why I cannot upload to the ATtiny in the same way I can on Windows. Has anyone ran into a similar problem?

Also I'm not running the latest version of Arduino because for some reason with V1.8.8 installed I cannot upload ANYTHING on either Windows or Linux for whatever reason so I just went back to the version I was using previously and stuck with it for now.

Thanks!

BJHenry

What error message do you get when you try to upload on the Linux machine? Which core are you using for the ATTiny, and do you definitely have it installed on the Linux machine?

pert

I'll take a wild guess that it's:
https://github.com/arduino/Arduino/issues/8032
but you'll need to answer BJHenry's questions before I could have any certainty of that.

MechEng87

here is the response when trying to burn a new bootloader to the ATtiny from Linux

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x15

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): unknown response=0x12
Error while burning bootloader.


the chip already has a bootloader on it from trying the same from my windows 10, and when trying to upload a blink program i get somethin similar below

Sketch uses 684 bytes (8%) of program storage space. Maximum is 8192 bytes.
Global variables use 9 bytes (1%) of dynamic memory, leaving 503 bytes for local variables. Maximum is 512 bytes.
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x15

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): unknown response=0x12
the selected serial port avrdude: stk500_disable(): unknown response=0x12
 does not exist or your board is not connected

MechEng87

Sorry, forgot about the second question. as for the core for the ATtiny. I added the link to the board manager box in the preferences window.

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

Just as I have on my windows machine.  I have followed the same process of uploading the Arduino as ISP to the nano as I would have on both machines and can successfully upload code as well as update the bootloader using windows 10.

pert

If you have a 10 uF capacitor, connect it between the Gnd and Reset pins on the Nano.

If you don't have a 10 uF capacitor then try rolling back to Arduino AVR Boards 1.6.21:
  • Tools > Board > Boards Manager
  • Wait for the downloads to finish.
  • Click on "Arduino AVR Boards".
  • Select 1.6.21 from the dropdown menu
  • Click "Install".
  • Wait for the installation to finish.
  • Click "Close".
  • Try the upload again.


Although you are using Arduino IDE 1.8.5 on both machines, the reason for the different behavior might be that you have two different versions of Arduino AVR Boards installed. There was a change in Arduino AVR Boards 1.6.22 and newer that makes it more likely that you need the capacitor.

MechEng87

Ok, that got things working thank you for the tip!

 but that brings me to another question, why?  You mention that I have two different versions AVR Boards installed. How is it that there are two different versions for the two OS's? Can I get the same software correctly installed on both or is that not an option?

MechEng87

Sorry for somewhat prematurely posting after fully reading your answer. I see that  I do have different versions of AVR boards installed on the two machines.  the windows machine is using V1.6.16 and the Linux machine V1.6.21. With the mention of V1.6.22 being the problem is it possible that it is still a problem this the 1 version earlier? Still would be interested as to why the different versions are affected by hardware changes simply out of curiosity...

pert

Are you talking about an error when uploading to the Nano? There was a change made to the Nano board definition in Arduino AVR Boards 1.6.21 that requires you to select Tools > Processor > ATmega328P (Old Bootloader) if you have an old official Nano or a Nano clone/derivative.

MechEng87

Ok I didnt realize that. Seems that at the moment I can get sketches uploaded just fine on my Windows10 machine now.  I have another issue that has come up, should I start another post regarding it or not?  Uploading works fine if I restart my machine but if I am musing other programs (pandora, KiCad, or internet browsers)  I can not upload any more. Below is what I get from the IDE.  I have admin rights on this machine and as far as i can tell, nothing is trying to use the COM port that I am trying to use. Arduiono IDE can see the COM port when it starts up as well. If theres more information that might help please let me know.

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
An error occurred while uploading the sketch
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\prima\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"

         Using Port                    : COM13
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't open device "\\.\COM13": Access is denied.

pert

The "Access is denied" error usually indicates that another application has the port open. A port can only be open in one application at a time so, if something else has it open, that will block the Arduino IDE from being able to upload to your board. If you have another application running that has the port open, tell it to close the port or exit the application, then try uploading again.

If that is not the case, try restarting your computer. Sometimes a glitch causes the port to get stuck open.

It's quite strange to me that any of the three applications you listed would open the COM port so maybe something else is is going on here.

Is it only those three that causes the problem, or is it any program?

Does any one of those programs cause the problem, or is it only if all three are running?

Go Up