Pro Trinket - can't upload code

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
Thov
 
Posts: 13
Joined: Fri Nov 27, 2015 6:37 am

Pro Trinket - can't upload code

Post by Thov »

Hey!

I've recently ordered ten of your Pro Trinket 3v, but I have trouble uploading code to seven out of the ten. The remaining three work just like they are supposed to according to your setup guide.
A little list of stuff I've done and tried with the seven that don't work:
- Arduino and Pro Trinkets are set up according to guide, with correct board definitions, using USBtinyISP, pressing reset before uploading, etc.
- I've updated and re-updated the drivers from your website (the 'USBTiny' folder) upon connecting the trinkets.
- I've done the hardware merging from your 'Adafruit_Arduino_Boards-master' folder in order to change the avrdude.conf file and drivers.
- Tried to burn the bootloader with a Uno.
- Tried with a 10K pull-up resistor between 3V and RX.
- I've used a computer with Windows 7 and a Mac, just change in error code (both computers could upload to the three PT's that worked).
- Sometimes they seem take inn the Blink sketch and the LED blinks like it's supposed to, but the IDE still doesn't say that the sketch uploaded correctly.
- Turn the computer on and off a lot, switching USB ports.

The error codes are the same that I've seen others post about:
" avrdude: verification error; content mismatch " and "avrdude: error: usbtiny_send: (expected 128, got -5)" and the stream of "(expected 4, got -5)".

What's strange is that three of them worked perfectly, and the others just didn't.
My next guess would be to try FDTI, but I don't have one available atm.
Any advice on what to do next?

Cheers!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Pro Trinket - can't upload code

Post by adafruit_support_rick »

Sometimes you can just ignore those errors. They're more if warning of retries on the data transfer. But I'm sensing that on the 7 trinkets, the uploaded code doesn't work? Is that true?

Are you using a USB 3.0 port? Can you try connecting through a self-powered USB2.0 hub?

User avatar
Thov
 
Posts: 13
Joined: Fri Nov 27, 2015 6:37 am

Re: Pro Trinket - can't upload code

Post by Thov »

Ok, good to know the errors do not necessarily mean total malfunction.
I'm only uploading the Blink example at this point, so the code itself is all good. Sometimes, the trinkets sort of receive the code and start blinking the LED as they are supposed to, but then they won't receive the code when I try again or with another sketch. And sometimes they either keep the LED permanently on or off, as if something crashed somewhere and the trinket just locks in one "state". In any case, uploading any code works very rarely, and never two times in a row.

Regaring the USB: My device manager says I have several types: six "Universal Host Controller" which indicates 1.1, two "USB2 Enhanced Host Controller" which indicates 2.0, one "USB Composite Device" that I don't know what means, and eight "USB Root Hub" which indicates 1.1 again.
I'm pretty noob on this, so if I can't use my own USBs, how would I go about getting a self-powered USB2.0 hub?
I don't know the USB types on the Mac I tried with.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Pro Trinket - can't upload code

Post by adafruit_support_rick »

We have hubs in the shop.
https://www.adafruit.com/products/961

Really, you can get one just about anywhere.

User avatar
Thov
 
Posts: 13
Joined: Fri Nov 27, 2015 6:37 am

Re: Pro Trinket - can't upload code

Post by Thov »

Alright, I'll try to get my hands on a hub asap! I'm in Norway, so waiting for shipping from abroad would take too much time.
Thanks for the tips, I'll reply when I've tried with the hub!

User avatar
Thov
 
Posts: 13
Joined: Fri Nov 27, 2015 6:37 am

Re: Pro Trinket - can't upload code

Post by Thov »

Actually, I have two interesting observations:
- The first Pro Trinket I ever connected to my PC is the only one that works perfectly. It receives the code and does exactly what it's supposed to. The two others that receive the code, seem to have trouble with my hardware, no internal error, it seems.
- The ten PT's arrived in different packaging: seven of them (!) came in the exact same packaging, while three came in slightly different packaging; all ten in the same box. What's especially interesting is that the first PT I tried (the one that works perfectly) was one of those three that came in a different packaging. I didn't notice what packaging the other two that work came in, but it fits a pattern. It makes me suspect that there's different firmware, versions of atmel chips, or something like that.

User avatar
Thov
 
Posts: 13
Joined: Fri Nov 27, 2015 6:37 am

Re: Pro Trinket - can't upload code

Post by Thov »

I've tried with a USB2.0 hub (although it gets its power from my own USB, not its own power supply), but no change in which PTs work and which don't.

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Pro Trinket - can't upload code

Post by adafruit2 »

ok first up, lets start with a known-good setup. please grab Arduino 1.6.4 or 1.6.5 (not 1.6.6) and use the Board manager to install Adafruit AVR Boards support. can you get the 'three known good' ones to work that way?

User avatar
Thov
 
Posts: 13
Joined: Fri Nov 27, 2015 6:37 am

Re: Pro Trinket - can't upload code

Post by Thov »

Yup, that is the setup I've been using today, and it's the same: three work, the rest don't.
I recently reverted to the 1.6.5 from 6.6 when the IDE stopped launching after I updated the avrdude.conf (i.e. I have not updated the avrdude.conf in the current 1.6.5).

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Pro Trinket - can't upload code

Post by adafruit2 »

yah you shouldnt mess with anything in avrdude or whatnot. does the bootloader start properly on the 7 you have? they get recognized by the usbtiny driver at all? maybe show a photo of what they look like?

User avatar
Thov
 
Posts: 13
Joined: Fri Nov 27, 2015 6:37 am

Re: Pro Trinket - can't upload code

Post by Thov »

Hm, I simply followed the Learn guide on manual installation of the boards where it said the avrdude.conf should be overwritten:
https://learn.adafruit.com/adafruit-ard ... ot-6-x-ide

Anyways, yes I think the bootloader starts as it's supposed to on all of them: pulsing light with a reset every 10 seconds. I noted that the three that work get little "flashes" when I upload code (like rx and tx on Uno), but the other ones don't do this. How do I tell if the usbtiny driver recognizes them? The error messages I wrote below seem to indicate that it does recognize the PTs, but I don't know..
Do you mean a picture of the PTs themselves, or screenshot with error messages?

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Pro Trinket - can't upload code

Post by adafruit2 »

you can see the protrinkets show up in teh Device Manager as USBTiny's if recognized. thats the first step
any photos or screenshots of anything would be useful :)

User avatar
Thov
 
Posts: 13
Joined: Fri Nov 27, 2015 6:37 am

Re: Pro Trinket - can't upload code

Post by Thov »

I've got screenshots of various errors here. As you can see, the USBtiny is always recognized in the Device Manager (forgot to expand on error 4, but I checked after).

Error 1: The error that shows up the most.

Error 2: The error that seems to show up when the bootloader stops mid-upload. When I press reset again and upload, error 1 usually follows.

Error 3: This error has come many times before, but this time it actually came after I managed to upload successfully to one of the PTs. I tried to upload again, and then this error came.

Error 4: This error doesn't show as frequently.

Hope this helps!
Attachments
Error 3.png
Error 3.png (265.7 KiB) Viewed 779 times
Error 2.png
Error 2.png (273.01 KiB) Viewed 779 times
Error 1.png
Error 1.png (242.94 KiB) Viewed 779 times

User avatar
Thov
 
Posts: 13
Joined: Fri Nov 27, 2015 6:37 am

Re: Pro Trinket - can't upload code

Post by Thov »

Error 4 picture.
Attachments
Error 4.png
Error 4.png (196.46 KiB) Viewed 779 times

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Pro Trinket - can't upload code

Post by adafruit2 »

by chance, can you try with a different computer? just to help determine what the issue is... we can replace the hardware but if it doesnt actually solve the problem then you'll just have more pro trinkets you can upload to :)

on that computer, dont edit any avrdude files or anything. *just* install 1.6.5 and the board manager software.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”