0

Gemma Bootloading Problems
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Gemma Bootloading Problems

by adafruit_support_rick on Thu Oct 10, 2013 7:14 pm

dafoink wrote:but, if it is plugged in, sometimes I get that, other times I get the ton of lines of errors.


What errors are you getting?

adafruit_support_rick
 
Posts: 34320
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Gemma Bootloading Problems

by Stevenlong1985 on Fri Oct 11, 2013 5:30 am

Good Morning all

I think the problem lies with in the Avrdude.conf file

Ladyada has one for Gemma here https://github.com/adafruit/Adafruit-Tr ... dition.txt

which doesnt seem to work for me and its different from the Gemma tutorial http://learn.adafruit.com/introducing-g ... rduino-ide

Just I cant get working either working :(
Stevenlong1985
 
Posts: 11
Joined: Wed Oct 09, 2013 11:10 am

Re: Gemma Bootloading Problems

by Stevenlong1985 on Fri Oct 11, 2013 6:02 am

My bad there both the same!
Stevenlong1985
 
Posts: 11
Joined: Wed Oct 09, 2013 11:10 am

Re: Gemma Bootloading Problems

by dafoink on Fri Oct 11, 2013 6:37 am

So you still can't get it working? Me either. Frustrating. Anyone out there get it working with windows? Or is this a problem with the Gemma?
dafoink
 
Posts: 15
Joined: Thu Jun 26, 2008 12:03 pm
Location: Redondo Beach, CA

Re: Gemma Bootloading Problems

by Stevenlong1985 on Fri Oct 11, 2013 7:00 am

I have tried using ubuntu aswell, and still no luck, same error :(
Stevenlong1985
 
Posts: 11
Joined: Wed Oct 09, 2013 11:10 am

Re: Gemma Bootloading Problems

by dafoink on Fri Oct 11, 2013 7:11 am

adafruit_support_rick wrote:
dafoink wrote:but, if it is plugged in, sometimes I get that, other times I get the ton of lines of errors.


What errors are you getting?


I get a ton of these:
avrdude: error: usbtiny_receive: usb_control_msg: sending control message failed, win error: The device does not recognize the command.

(expected 4, got -5)


NOTE: I sit and watch device manager, and it will sporadically show the gemma reboot. it doesn't seem 10 seconds. every once and awhile, it just goes into a vicious reboot cycle where it will go up and down every second or so.
dafoink
 
Posts: 15
Joined: Thu Jun 26, 2008 12:03 pm
Location: Redondo Beach, CA

Re: Gemma Bootloading Problems

by adafruit_support_rick on Fri Oct 11, 2013 9:14 am

My understanding is that the "expected 4, got 5" errors are a problem with avrdude.conf. You might want to do a search for avrdude.conf - you may have more than one.

adafruit_support_rick
 
Posts: 34320
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Gemma Bootloading Problems

by dafoink on Fri Oct 11, 2013 9:42 am

adafruit_support_rick wrote:My understanding is that the "expected 4, got 5" errors are a problem with avrdude.conf. You might want to do a search for avrdude.conf - you may have more than one.


I did a search of the whole c:\program files\arduino, and only found the one. I did a diff on what I have there and what I got from the below URL and my file matches the file that is on your site (the one we are supposed to use to replace the original)

http://learn.adafruit.com/system/assets/assets/000/010/769/original/avrdude.conf?1378221965

which section of the conf file is specific to the gemma? I just want to confirm that I have the absolute proper conf file.
dafoink
 
Posts: 15
Joined: Thu Jun 26, 2008 12:03 pm
Location: Redondo Beach, CA

Re: Gemma Bootloading Problems

by Stevenlong1985 on Fri Oct 11, 2013 10:40 am

I have tried using Avrdude GUI on windows, just to get a connection but no luck and still getting

trying to connect to device...
avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)

avrdude done. Thank you.


:(
Stevenlong1985
 
Posts: 11
Joined: Wed Oct 09, 2013 11:10 am

Re: Gemma Bootloading Problems

by adafruit_support_rick on Fri Oct 11, 2013 11:19 am

OK - I just went through this again with a fresh Trinket and a fresh Gemma.
You have to follow the instructions here very carefully:
http://learn.adafruit.com/introducing-t ... th-avrdude

Step 1 is to make sure you have the right version of avrdude in Windows. Download and install this one:
http://download.savannah.gnu.org/releas ... -win32.zip

Now, open a Command window, and type avrdude -v. This will give you the version number, which should give you something like this:
Code: Select all | TOGGLE FULL SIZE
avrdude: Version 5.11-Patch#7610, compiled on Aug 31 2011 at 08:02:19
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"


avrdude: no programmer has been specified on the command line or the config file
         Specify a programmer using the -c option and try again


The updated avrdude.conf goes in the same place listed after System wide configuration file is

Once you have the updated avrdude.conf in place, run avrdude -v again. If you see any errors about unrecognized characters, just stop and let me know here.

Step 2: Download the TrinketBlink.hex file. Right click on this link, and select "Save Link as...", to download and save the file to a convenient place.
http://learn.adafruit.com/system/assets ... 1378909867

Go back to your Command window, and cd to the folder where you stored trinketblink.hex.

Step 3:
In you command window, enter the following command BUT DON"T PRESS RETURN YET:
Code: Select all | TOGGLE FULL SIZE
avrdude -c usbtiny -p attiny85 -U flash:w:trinketblink.hex

Now, press the reset button on the Gemma (or Trinket). The red LED will start to flash. Wait for the chime that indicates a new device has been attached, and immediately press return in the Command window.

If you see this:
Code: Select all | TOGGLE FULL SIZE
avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)

it means that either:
1) you weren't quick enough, and the bootloader timed out before avrdude got started
2) you hit return before the device attached chime

Try again, and try to get the timing right.

If you're successful, you should see this, and the red led will start a slow 1-second blink:
Code: Select all | TOGGLE FULL SIZE
C:\Projects\adafruit\Trinket>avrdude -c usbtiny -p attiny85 -U flash:w:trinketblink.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e930b
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 "trinketblink.hex"
avrdude: input file trinketblink.hex auto detected as Intel Hex
avrdude: writing flash (832 bytes):

Writing | ####                                               | 7% 0.03savrdude: 3 retries during SPI command
Writing | ########                                           | 15% 0.08savrdude: 3 retries during SPI command
Writing | ############                                       | 23% 0.12savrdude: 3 retries during SPI command
Writing | ###############                                    | 30% 0.17savrdude: 3 retries during SPI command
Writing | ###################                                | 38% 0.22savrdude: 3 retries during SPI command
Writing | #######################                            | 46% 0.27savrdude: 3 retries during SPI command
Writing | ###########################                        | 53% 0.33savrdude: 3 retries during SPI command
Writing | ###############################                    | 61% 0.37savrdude: 3 retries during SPI command
Writing | ###################################                | 69% 0.42savrdude: 3 retries during SPI command
Writing | ######################################             | 76% 0.47savrdude: 3 retries during SPI command
Writing | ##########################################         | 84% 0.52savrdude: 3 retries during SPI command
Writing | ##############################################     | 92% 0.56savrdude: 3 retries during SPI command
Writing | ################################################## | 100% 0.61s



avrdude: 832 bytes of flash written
avrdude: verifying flash memory against trinketblink.hex:
avrdude: load data flash data from input file trinketblink.hex:
avrdude: input file trinketblink.hex auto detected as Intel Hex
avrdude: input file trinketblink.hex contains 832 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.11s



avrdude: verifying ...
avrdude: 832 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

adafruit_support_rick
 
Posts: 34320
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Gemma Bootloading Problems

by mauimacman on Fri Oct 11, 2013 11:41 am

Thanks for feedback & suggestions Even & Rick. It could INDEED be that programmer is set wrong. Sorry to say I'm too frustrated for (continuing typed out) words at the moment, so I'm going to shelve any more time wasting; searching, weeding thru, post after post for answers ...when a little realtime handholding will likely solve many issues. Thats why I want my Creativity Cafe™ but for now i'll wait til I get to SF, to sit with an engineer buddy; knowledgeable with micro's and blinkies. That said, i'm also determined to have my light painting "paint brushes" work so No doubt I'll give it (Gemma/Trinket) one more try to make the "Neopix-Ring" sing before SF and seeking Hacker-Maker spaces for wisdom & solutions :P

mauimacman
 
Posts: 33
Joined: Thu Jan 24, 2013 11:00 pm

Re: Gemma Bootloading Problems

by dafoink on Fri Oct 11, 2013 11:53 am

I checked the version, and didn't have that patch. so, I downloaded and got this when I run:

Code: Select all | TOGGLE FULL SIZE
C:\temp>avrdude -v

avrdude: Version 5.11-Patch#7610, compiled on Aug 31 2011 at 08:02:19
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardw
are\tools\avr\bin\avrdude.conf"


avrdude: no programmer has been specified on the command line or the config file

         Specify a programmer using the -c option and try again


after that, I made sure that I re-downloaded the avrdude.conf (from http://learn.adafruit.com/system/assets/assets/000/010/752/original/avrdude.conf?1378151630 to the directory it wanted, I then re-ran the -v and got this:
Code: Select all | TOGGLE FULL SIZE
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin>.\avrdude -v

avrdude: Version 5.11-Patch#7610, compiled on Aug 31 2011 at 08:02:19
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardw
are\tools\avr\bin\avrdude.conf"
error at C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.conf:1524
 unrecognized character: "i"

dafoink
 
Posts: 15
Joined: Thu Jun 26, 2008 12:03 pm
Location: Redondo Beach, CA

Re: Gemma Bootloading Problems

by adafruit_support_rick on Fri Oct 11, 2013 12:18 pm

OK - I had the same problem. Open avrdude.conf in a text editor (not notepad - it doesn't understand the linefeeds in the file), and delete line 1524. The line to delete looks like this:
Code: Select all | TOGGLE FULL SIZE
    is_at90s1200     = yes;

adafruit_support_rick
 
Posts: 34320
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Gemma Bootloading Problems

by dafoink on Fri Oct 11, 2013 12:31 pm

NOTE: I cant get things to work in the IDE but avrdude commandline works. any way that the IDE can call avrdude the same way?

Eureka! that helped. and I no longer got the error. but then I was getting this:
Code: Select all | TOGGLE FULL SIZE
C:\temp>avrdude -c usbtiny -p attiny85 -U flash:w:trinketblink.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e930b
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: error: usbtiny_receive: usb_control_msg: sending control message failed
, win error: A device attached to the system is not functioning.
 (expected 4, got -5)

avrdude: error: usbtiny_transmit: usb_control_msg: sending control message faile
d, win error: A device attached to the system is not functioning.

avrdude: reading input file "trinketblink.hex"
avrdude: input file trinketblink.hex auto detected as Intel Hex
avrdude: writing flash (832 bytes):

Writing |                                                    | 0% 0.00s
avrdude: error: usbtiny_send: usb_control_msg: sending control message failed, w
in error: A device attached to the system is not functioning.
 (expected 64, got -5)

avrdude: error: usbtiny_receive: usb_control_msg: sending control message failed
, win error: A device attached to the system is not functioning.
 (expected 4, got -5)


and the (expected 4, got -5) was infinite.

so, I did the -D on the command line, and then it worked!

Code: Select all | TOGGLE FULL SIZE
C:\temp>avrdude -c usbtiny -p attiny85 -D -U flash:w:trinketblink.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e930b
avrdude: reading input file "trinketblink.hex"
avrdude: input file trinketblink.hex auto detected as Intel Hex
avrdude: writing flash (832 bytes):

Writing | ################################################## | 100% 0.79s



avrdude: 832 bytes of flash written
avrdude: verifying flash memory against trinketblink.hex:
avrdude: load data flash data from input file trinketblink.hex:
avrdude: input file trinketblink.hex auto detected as Intel Hex
avrdude: input file trinketblink.hex contains 832 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.21s



avrdude: verifying ...
avrdude: 832 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.


Now, if we could only get this working in the IDE so I don't have to figure out how to compile manually.
dafoink
 
Posts: 15
Joined: Thu Jun 26, 2008 12:03 pm
Location: Redondo Beach, CA

Re: Gemma Bootloading Problems

by Evan_Pierce on Fri Oct 11, 2013 2:22 pm

(Just a quick note to say that you are all awesome. I'm loving seeing everyone explain what they're seeing for all the different pitfalls that are easy for competent people to stumble into. I think this thread has been great and hopefully could be a totally valuable resource for others struggling to get Gemma / Trinket to work. I'll give an update tomorrow once I've tried all these ideas for troubleshooting / getting it to work)
Evan_Pierce
 
Posts: 30
Joined: Thu Sep 12, 2013 3:30 pm

Please be positive and constructive with your questions and comments.