0

Trinket M0 Bootloader modification? ++ KUDOS.
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket M0 Bootloader modification? ++ KUDOS.

by Govner on Sun Aug 12, 2018 8:26 am

Hi all,

First I want to praise Adafruit for ALL that you all do to stimulate so much creativity and excitement in the electronics world. As a youngster who discovered the fantasy world of vacuum tubes as the transistor's (solid-state) arrival onto the scene, today's "magic" is so thrilling and simply an overwhelming joy in retirement. I "play" in my lab all night, sleep days, 24/7 "Adafruit on my mind". (Reminds me of a song title.) So, THANK YOU ALL.

Uht-Oh, here it comes, you might be thinking. Well, maybe so because I am asking for a huge favor. I have LOTS of these Adafruit projects going on -- especially now, centered around the Trinket M0. Spending as much as 18-hour all-nighters in my "lab" with these little jewel Trinkets in the Windows environment, and knowing what you do about that combination, then you know the goat-rope routines I go through with Trinket M0 not staying "connected" to USB port. That is, not staying connected in that I have to plug/unplug USB and/or go to the PORT menu in Arduino IDE to re-establish a connection. Double-click, single-click, cable connect/re-connect, etc. is one big circular WT#*@ feeling that gets might old after about the 12-hour point in my Trinket day. So, here goes a question:

Owing to the fact that this Trinket has its own type of specialized bootloader to accommodate CircuitPython users, I'm sure that Windows and the Arduino IDE can't quite deal with the presence of the "virtual disk drive" and other things that only you folks are smart enough to know. In my simple observation, it's this difference that must be the problems I have. Don't get me wrong, except for these USB dances that wear me completely out, I LOVE this new SAMD21 power. Soooooo, I'm thinking that during your development process, before CircuitPython bootloader ideas came along, there just might be some bootloader code you wrote. If that's true, or can be made available (PLEASE), then perhaps being a dedicated die-hard Arduino IDE fan (advanced aging), I could delete (or write-over) this "front-end" and replace it with a simpler Arduino IDE-friendly version. Can we PLEASE do that? I am way too old to transition in other directions so you guys/gals are my only hope. Georgia Tech is one thing. MIT another. Get my drift?

Thank you all very much,
Govner

PS: It's 8 AM and time to retire -- too tired after Trinket all-nighter to edit for grammar, etc. Sorry.
Last edited by Govner on Tue Aug 14, 2018 12:29 am, edited 1 time in total.

Govner
 
Posts: 73
Joined: Wed Sep 14, 2016 4:42 pm

Re: Trinket M0 Bootloader modification? & THANK YOU.

by adafruit_support_bill on Sun Aug 12, 2018 9:16 am

Thanks for the suggestion. I will relay that to the engineering team.

adafruit_support_bill
 
Posts: 72783
Joined: Sat Feb 07, 2009 10:11 am

Re: Trinket M0 Bootloader modification? & THANK YOU.

by BryonMiller on Sun Aug 12, 2018 9:52 am

@govner I remember having the same frustrations and making the same wish but never getting as far a actually asking for it. I instead took another approach. I wrote my own windows serial monitor. It has the feature that if the serial port that it is connected to should go away it'll wait around to see if it comes back. And when it does come back, unlike the Arduino serial monitor, mine will reconnect.

So as I use it I just leave the Arduino IDE set up with the download port and my monitor set up to the Trinket's communication port and my frustration level greatly subsided.

You can check out a thread about it here. You'll see that @danhalbert made another suggestion but I never checked it out to see if it was any better.

Us old tube guys gotta stay together.

BryonMiller
 
Posts: 161
Joined: Fri Mar 04, 2016 10:34 am

Re: Trinket M0 Bootloader modification? & THANK YOU.

by Govner on Sun Aug 12, 2018 10:52 am

Hello there Byron,

Thanks for taking the time to reply. That's a great idea about using a disassociated monitor. Since my project uses multiple Trinkets, I had considered such a schema rather than "hot swapping" USB cables. But, this issue is not actually the USB connection problems I was trying to address. It's not serial monitoring that frustrates me (although I know exactly what you are addressing with that), my fatigue comes from the stubborn nature of Windows to be constantly cycling between ports and having to do a type of pull-down menu dance to tell the Arduino UI what to re-connect to. With the Trinket Pro 5, Trinket 5v, Trinket 3V, Metro-Mini, and all the originals like UNO, hot-swapping from one unit to another is far simpler. That's why I seek a bootloader that's also simplified (I guess "simplified" is not the right word since these bootloaders are beyond anything I can do.) Anyway, I'd love to solve this because I have many more moons of development planned and this monkey motion of mine is pretty silly. I know these smart folks know exactly how to do it but I am reluctant to impose. At the same time, I have a feeling that lots of folks besides me will breathe easier knowing that a cure is forthcoming.

Nice meeting you.
Govner

PS: My current project. Multiple Trinket's (MO and vintage) , all I2C linked, MCP23017 port xpndr, 24LC64 EEPROM, MAX9814, BUCK, Trinket 5v used as OVP monitor, rotary encoder, NEOPIXEL 24 (not shown, Neo-7 for prototyping). Fun stuff. Having a ball.

Breadboard_IMG_4145.jpg
Breadboard_IMG_4145.jpg (132.33 KiB) Viewed 301 times

Govner
 
Posts: 73
Joined: Wed Sep 14, 2016 4:42 pm

Re: Trinket M0 Bootloader modification? & THANK YOU.

by adafruit2 on Sun Aug 12, 2018 12:43 pm

i dont think this a bootloader thing, right?

this is a 'arduino is not doing a good job knowing what the upload/communication serial port' is, and its confused?

that is - sadly, an arduino ide issue we've seen - a bootloader isn't going to help (likely)

what OS are you running

adafruit2
Site Admin
 
Posts: 18327
Joined: Fri Mar 11, 2005 7:36 pm

Re: Trinket M0 Bootloader modification? & THANK YOU.

by Govner on Sun Aug 12, 2018 1:55 pm

Thanks for replying.

To avoid a circular subjective kind of discussion from this end, let me just say that it all boils down to this:

Heretofore, same OS, same everything -- Trinket Pro, Trinket, Metro-mini, etc. - all do a fine job managing to communicate/exchange the necessities with Windows to be predictable and easy to use. I was simply hoping to make that point since SOMETHING has changed and to me, the difference is the 'discovery' by Windows that there's a virtual disk drive to contend with when it first sees my new Trinket M0s. In the process of dealing with this, Windows, - I agree - has a difficult time assigning ports consistently. During this process, it's not about Arduino IDE at all. That's easy to discern just by watching the Device Manager's reaction to connecting from one Trinket M0 to another. Windows has a real need to "New Device Detected" type of dialog and subsequently displaying the 'virtual drive' and its file complement. It's this additional tasking of Windows device manager that intercedes or basically gets in the way - something that wasn't present to interfere with the legacy Trinket's smooth operation. I am not qualified to debate the whys, whens, and wheres of bootloaders it just seems intuitive to me that prior to this new 'virtual disk' which Windows detects and illustratively/audibly announces, the many Trinket products I use everyday have no such issues. I sense that we can't blame OS, Arduino IDE, no more than blaming SAMD21. I leave it there since I have no options. Perhaps the brighter minds have a way to eliminate the 'virtual drive' for those who don't want it or need it. (fingers crossed).

All the best,
Gov

Govner
 
Posts: 73
Joined: Wed Sep 14, 2016 4:42 pm

Re: Trinket M0 Bootloader modification? & THANK YOU.

by aaronaverill on Mon Aug 13, 2018 12:00 pm

If you want to stay in the adafruit ecosystem, you can probably solve this by going to an itsy-bitsy, which has the flash drive on an external SPI chip, so the serial number of the drive volume isn't constantly changing when you load your sketches and windows won't keep reassigning different COM ports? I could test this behavior on my trinket vs feather which has the same external SPI drive if you're inclined to upgrate to itsy bitsy. It will cost you a whopping $3 more. :) You'll also get +2MB to play around with, instead of the 30KB or so with the trinket. And 18 more pins, if that's your thing. Otherwise it's identical.

I suspect that the problem with burning a custom bootloader is you will have to access programming pins on the SAMD that are not brought out on the trinket. Which will be a tricky soldering challenge! Adafruit has an article from 2016 but it has lots and lots of caveats about it not being supported. Probably at that point you'd be just as well to go to another vendor that has the SAMD21 boards.

https://learn.adafruit.com/compiling-m0 ... er/compile

This article has a schematic of the programming for the bootloader, but alas, it is for the 21G, an the trinket uses the 21E. So there is still a lot of fiddling to do, and you'd still have to precisely solder those QFP leads.

http://www.avdweb.nl/arduino/samd21/sam ... ammer.html

I guess the other question is why use the trinket M0 at all, if you can use the attiny85 versions?

aaronaverill
 
Posts: 80
Joined: Sun Jun 03, 2018 10:45 am

Re: Trinket M0 Bootloader modification? & THANK YOU.

by Govner on Mon Aug 13, 2018 12:04 pm

To clarify any questions, earlier comment "Georgia Tech is one thing. MIT another. Get my drift?"
was my attempt at bending the knee but perhaps misunderstood. I was a Yellow Jacket, BEE class '72 but traded my cubical at Scientific Atlanta for a tail hook. All good.

Govner
 
Posts: 73
Joined: Wed Sep 14, 2016 4:42 pm

Re: Trinket M0 Bootloader modification? & THANK YOU.

by Govner on Mon Aug 13, 2018 12:12 pm

Hey aaronaverill,

Sorry I didn't see your comment before bloviating.

Thanks for the ideas. While out of my skill set at present, I will look into them.

I developed my project using all manner of Trinket 5V, 3V, Trinket PRO, Metro-Mini etc. It's the speed and memory I sought so when the M0 appeared, I jumped right on it. I REALLY find it to solve lots of issues I needed addressing.

Thanks for taking the time to ponder the subject. I think I read somewhere on the site that this is a beta version. So, who knows what's coming if that's true. In the mean time, when I cycle between the three MO's in my project, I will just put up with Windows shenanigans for now.


Good luck to you and take care,
Govner
Last edited by Govner on Mon Aug 13, 2018 12:23 pm, edited 1 time in total.

Govner
 
Posts: 73
Joined: Wed Sep 14, 2016 4:42 pm

Re: Trinket M0 Bootloader modification? & THANK YOU.

by aaronaverill on Mon Aug 13, 2018 12:19 pm

ATTiny85 = 8mhz and 8KB flash and 512 bytes RAM. That is what your old trinket is running. Sounds like a non-starter.

Let me do some diddling on my feather and trinket tonite and see if the volume serial # change is causing the COM port reassignment. That is your primary concern right? And that the Arduino IDE doesn't pick up the new port automatically?

If that is the case, and the feather doesn't have this problem, here could be your easier solution:

https://www.adafruit.com/product/3727

If that product doesn't work I would be curious to know why (cost, weight, size?)

aaronaverill
 
Posts: 80
Joined: Sun Jun 03, 2018 10:45 am

Re: Trinket M0 Bootloader modification? & THANK YOU.

by Govner on Mon Aug 13, 2018 12:39 pm

Hey again,


I will definitely order the Express M0 and give it a shot. It's 30% more (if and when I need to make a big order) but if these handle smoother, I'll bite the bullet....Thanks!


I must have been editing my post simultaneously when you were replying. We need to get a day job !!

Hey, that's very gracious of you to look deeper. To be clear, here's what I am seeking to change about my process. First, let me quickly say how it goes with legacy Attiny85 guys,

If I have several Trinket Pro5V (for example) and of course all with USB cables connected, I only connect one at a time to Windows. That's obviously so I can have access to the particular Trinket's Serial.prints. All good. When I disconnect that USB cable and go over to another Trinket in the project, Windows recognizes it with a ding/found hardware/etc (no problem) and it's immediately recognized by Arduino's IDE. I click and go with it. From that point on, there is no dropping out of the port or any problems with the Serial monitor losing it's connection. It's just a smooth experience. With the M0 (in my set up here) not so much.

When I do the same general actions using the Trinket MOs, I just never know until the compiler balks at the upload. I mean, even if the Arduino Tools Menu clearly shows a check mark on the selected port, it's likely that the first attempt at uploading will fail and I'll have to disconnect/re-connect the USB cable (easiest method) or worse, go to the Device Manager and "Update Driver" over and over. I'm sorry that I don't have the expertise to use better descriptions for you. However, the fact that the ATTINY85 devices use some methodology (my perception not fact) that is different and smoother, I just seek a continued good smooth experience. Really, sir, as many hours as I spend doing this 7-days/week, this really begs for relief.

Again, thanks for speaking up and explaining things. I don't wish to impose on your time. I will just wait to see what comes. I can see that I have lots of company in this regard. What is it they say about "the mother of invention" ?

You take care sir,
Govner

Govner
 
Posts: 73
Joined: Wed Sep 14, 2016 4:42 pm

Re: Trinket M0 Bootloader modification? & THANK YOU.

by aaronaverill on Mon Aug 13, 2018 12:55 pm

Interesting. I use Windows 10 and don't really see these problems with my trinket. Curious.

aaronaverill
 
Posts: 80
Joined: Sun Jun 03, 2018 10:45 am

Re: Trinket M0 Bootloader modification? & THANK YOU.

by Govner on Mon Aug 13, 2018 1:19 pm

Windows 10.. roger. And, to be clear, that's a Trinket MO? Thanks again.

Govner
 
Posts: 73
Joined: Wed Sep 14, 2016 4:42 pm

Re: Trinket M0 Bootloader modification? ++ KUDOS.

by Govner on Tue Aug 14, 2018 12:42 am

Mr. AaronAverill,

I followed your advice, sir, and ordered a couple of the ItsyBitsy M4's (from Digikey only because Miss Lady Ada was out of stock at the moment). I'm excited about the anticipated extra speed and memory and even hoping to get away with changing from having to use tandem/parallel M0s to using a single ItsyBitsy. The total cost is less -- so, win-win. The helpful suggestions are much appreciated and highly valued.

Have a good Tuesday.
Govner

Govner
 
Posts: 73
Joined: Wed Sep 14, 2016 4:42 pm

Re: Trinket M0 Bootloader modification? ++ KUDOS.

by aaronaverill on Tue Aug 14, 2018 9:26 am

Apologies. I didn't get to try this. I was playing around with some neopixel projects.

May I ask what you are doing that requires so many microprocessors?

aaronaverill
 
Posts: 80
Joined: Sun Jun 03, 2018 10:45 am

Please be positive and constructive with your questions and comments.