Tutorial  Updated

How To Flash The Trinket M0 Using Arduino

Arduino Setup For Use With The Trinket M0 Switch D-I-Y Dongle..

Step 1)

Install The Arduino-1.8.5 Software & Adafruit_Drivers_2.2.0.0

Step 2)

Once Both Are Installed Run The Arduino Software & Goto Flies,Scroll Down To Preferences Tab, Settings Pops Up Go Down To Additional Boards Manager URLs And Click The Box On The Right Of The Blank Space.

1.jpg
2.jpg
boards manager url.jpg


Step 3)

The Additional Boards Manager URL Box Will Pop Up, Now Copy & Paste This URL Into The Box, (CTRL+V) To Paste https://adafruit.github.io/arduino-board-index/package_adafruit_index.json Into The Box Then Press Ok & Ok Again.

4.jpg
3.jpg


Step 4)

Now Goto The Tools Tab & Scroll to Board & Select Board Manager Once The Board Manager Pops Up, Type Trinket In The Search Bar Then Click On Adafruit SAMD Boards by Adafruit & Click On Install, Once The Install Has Completed Then Click On The Close Tab.

tools.jpg

board manager.jpg

type trinket.jpg

install trinket.jpg
installed.jpg


Step 5)

Now Close Arduino Software & Goto C:\Program Files (x86)\Arduino\examples Folder & Place The 12.Nintendo_Switch_Fusee_Launcher Folder Into The Examples Folder,Once Thats Done You Can Close Everything.

examples folder.jpg
flash files.jpg


Step 6)
Now Your All Set To Flash Any One Of The Payloads To The Trinket M0 Dongle, So Restart The Arduino Software & Goto Tools Then Scroll Down To Board & Locate The Adafruit Trinket M0 Board & Select It, You Should See Adafruit Trinket M0 on Com4 or A Different Number Com Port In Bottom Right Corner.

tools.jpg
select trinket M0.jpg


Step 7)
Now Plug In Your Trinket M0 Then Goto Tools Again & Scroll Down To Port & Select The Port That The Trinket M0 Is Contected To, If Unsure Then Goto Device Manager Then Ports(COM & LPT) & It'll Show The Trinket M0 & COM Number It's Connected To.

select port.jpg


Step 8)
Now Goto File & Scroll Down To Examples Then Scroll To 12.Nintendo_Switch_Fusee_Launcher & Select One Of The Payloads You Want To Flash To The Trinket.

select the flash file.jpg


Step 9)
Now The Payload Of Your Choice Pops Up & Your Ready To Go.

loaded flash.jpg


Step 10)
You Want To Compile The Sketch Ready To Flash & Make Sure No Issues Before You Flash, Just Click On The Tick.

verify.jpg


Step 11)
Now Compiling Is Done Your Ready To Flash To The Trinket M0, So Click On The Arrow Tab To Upload To The Trinket & Wait For The Flash To Complete, You Should See Upload Done Message Once That Is Shown Then You Can Remove The Trinket From Your Pc Or Laptop.

done compiling.jpg
upload.jpg


Final Step)
If All Went Well Then Your Ready To Use Your New D-I-Y Trinket M0 Dongle.
Make Sure You Have The Correct Sd Card Files For The Payload That You Flashed To The Trinket.


If You Get This Error When Trying To Upload Your Payload File.

java.io.IOException: Cannot run program "{runtime.tools.bossac-1.7.0.path}/bossac": CreateProcess error=2, The system cannot find the file specified

Then This Is The Fix For The Error
Goto Tools Scroll To Boards Then Select Board Manager And Type Arduino SAMD Into The Search Bar.

error.jpg


Then Once Installed Click The Close Tab,Now You Can Upload Your Payload File.

Think That Covers Everythig.

Edit..

Updated Payload INO Files These Are Now All In One, So You Enable The Payload You WantTo Use, And Disable The 3 You Don't Want To Use.

the only UF2 d&d files are for the multi payload gemma/trinket and itsybitsy UF2 File has not been tested as of yet as I don't have one to hand.

gemma/trinket and itsybitsy files are for dongle only at moment as.

pad A0 = payload change on gemma and itsybitsy.

pad 1 = payload change on the trinket.

the multi can only have 3 payloads enabled due to flash on the trinket/gemma & itsybitsy flash not being big enough.

red = sxos
white = hekate
blue = ReiNX

demo of the multi payload on my trinket.



demo if multi payload working.




ReiNX
RajNX
SXOS
Hekate 4.0

have revamped ino to all in one code

just enable the payload you wish to use. and disable the other 3.

like in the image sx os is enabled and the others are disabled.


Trinket All In One.jpg
 

Attachments

  • all in one payload ino files.zip
    1.7 MB · Views: 705
Last edited by M-O-B, , Reason: Updated Files.

M-O-B

Well-Known Member
OP
Member
Joined
Jun 23, 2018
Messages
281
Trophies
0
Age
54
XP
583
Country
United Kingdom
this may work on the r4, this is just a edited version of the multi that mattytrogs posted in his thread, think it was for the itsybitsy originally I think.

just a couple of bits to edit then it should be ready to test on the r4 dongle.

 

yakuma

Well-Known Member
Newcomer
Joined
Dec 27, 2007
Messages
75
Trophies
0
XP
572
Country
Indonesia
this may work on the r4, this is just a edited version of the multi that mattytrogs posted in his thread, think it was for the itsybitsy originally I think.

just a couple of bits to edit then it should be ready to test on the r4 dongle.


yeyyy thanks
 

M-O-B

Well-Known Member
OP
Member
Joined
Jun 23, 2018
Messages
281
Trophies
0
Age
54
XP
583
Country
United Kingdom
yeyyy thanks

you can give this a try if you want on your R4 let me know if it works, just press the reset button on the R4 to change payloads or let it auto change once it fails to load a payload.

on my trinket led behaviour is red for sxos white for hekate and blue for ReiNX.

not sure how the led behaviour would be on the R4.

this is just and edited version of one of mattytrogs multi codes.

I'm also trying to get the multi.h to work with 4 payloads, but flash is to small, to get more payloads to work I'm trying to figure out how to get this done using dat files place on root of sd card, but am not getting any joy yet after I create the new multi.h file.

if I try mattytrogs multi 8 payload.h then everything loads, seems my created multi h file is totally different once done.

I could just use mattytrogs payload h file but that's not what I want to do, mainly because I create my sd card files from the sources and sometimes the bin files are different from the release versions of the bin.
 
Last edited by M-O-B, , Reason: typo again

yakuma

Well-Known Member
Newcomer
Joined
Dec 27, 2007
Messages
75
Trophies
0
XP
572
Country
Indonesia
you can give this a try if you want on your R4 let me know if it works, just press the reset button on the R4 to change payloads or let it auto change once it fails to load a payload.

on my trinket led behaviour is red for sxos white for hekate and blue for ReiNX.

not sure how the led behaviour would be on the R4.

this is just and edited version of one of mattytrogs multi codes.

I'm also trying to get the multi.h to work with 4 payloads, but flash is to small, to get more payloads to work I'm trying to figure out how to get this done using dat files place on root of sd card, but am not getting any joy yet after I create the new multi.h file.

if I try mattytrogs multi 8 payload.h then everything loads, seems my created multi h file is totally different once done.

I could just use mattytrogs payload h file but that's not what I want to do, mainly because I create my sd card files from the sources and sometimes the bin files are different from the release versions of the bin.
not working
 

Holli12345

Member
Newcomer
Joined
Aug 26, 2018
Messages
7
Trophies
0
Age
42
XP
258
Country
Albania
Ok as I see there are two "Gemma" related" subfolder in the all in one zip.

Right now I have an Gemma on site and I want to flash it. Can I use the tutorial from page 1?
Iam unsure because there is an extra folder with the payloads. Do I still have the need of that?

An short tutorial would be very great! Thanks a lot!
 
Last edited by Holli12345,

yakuma

Well-Known Member
Newcomer
Joined
Dec 27, 2007
Messages
75
Trophies
0
XP
572
Country
Indonesia
when you say not working how do you mean excatly, just saying not working is no help to me in trying to get something working for the R4.

but the individual codes worked ok both of them..
individual code is working.
but try multy loader is nor working.
try to press the button not respon just blink
 

M-O-B

Well-Known Member
OP
Member
Joined
Jun 23, 2018
Messages
281
Trophies
0
Age
54
XP
583
Country
United Kingdom
individual code is working.
but try multy loader is nor working.
try to press the button not respon just blink

so nothing happens when you press the reset button, no led blink nothing I would of thought it would of loaded at least one of the payloads from the multi payload.

I may have to get one of these r4 dongles just to see how they are made and what's used in it.

not found any kind of tear down of one yet.

I have redone the code so it's just auto now, works perfectly on a trinket and gemma, but I expect it not to work on the R4.

 

BenLM

Member
Newcomer
Joined
Sep 1, 2018
Messages
10
Trophies
0
Age
46
XP
63
Country
France
Good morning,
Thanks a lot for this tutorial it helps to understand how it works.

I have a problem with Arduino I have the following error
upload_2018-9-1_18-5-12.png


Also I'm told that you have to put an uf2 on the Trinket M0 but I don't see that appear in the tutorial and I saw that there are some in the zip file but I'm not sure that those are the ones you should use.

If you could give me some information.

Thank you in advance.
 

mattytrog

You don`t want to listen to anything I say.
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Good morning,
Thanks a lot for this tutorial it helps to understand how it works.

I have a problem with Arduino I have the following error
View attachment 141865

Also I'm told that you have to put an uf2 on the Trinket M0 but I don't see that appear in the tutorial and I saw that there are some in the zip file but I'm not sure that those are the ones you should use.

If you could give me some information.

Thank you in advance.

Have you installed the dotstar lib?

https://github.com/adafruit/Adafruit_DotStar
 
  • Like
Reactions: BenLM and M-O-B

M-O-B

Well-Known Member
OP
Member
Joined
Jun 23, 2018
Messages
281
Trophies
0
Age
54
XP
583
Country
United Kingdom
here you go ladies and gents.

2 versions of the multi payload for the trinket & gemma.

manual and auto selection of the payloads.

multi 4 payload requires dat files on root of sd card.

triple payload requires the normal bin files placed in your normal place you have them.

example my bin files are in bootloader/payloads folder since v4.0 of hekate was released.

I've added a couple of links for the custom boot files to create the dat files and the payload files to drag and drop onto the trinket or gemma.

the auto payload ones may work on the R4 dongle and sx gear once it gets released.

have not tested on the r4 dongle as I don't have one,



these are just Edited versions of one of mattytrogs codes he posted in his thread, so thanks to him and the original source for the codes.

these are just aimed at dongles really.

for the multi 4 payload you can mix the dat files around to the order you rather have.

just make sure you name them correct to boot in the order you want.

example default

sxos 0001
hekate 0002
ReiNX 0003
RajNX 0004.

change to what you want.
example
hekate 0001
ReiNX 0002
briccmii 0003
memloader 0004

I will see about getting an R4 dongle to try sort multi files out for that if none ave been done.

but it's not on my priority list.

plus if anyone has any idea what can be used that has bigger flash than a trinket then feel free to let me know, that's more for my personal use as I want multi payload but not using dat files.

Good morning,
Thanks a lot for this tutorial it helps to understand how it works.

I have a problem with Arduino I have the following error
View attachment 141865

Also I'm told that you have to put an uf2 on the Trinket M0 but I don't see that appear in the tutorial and I saw that there are some in the zip file but I'm not sure that those are the ones you should use.

If you could give me some information.

Thank you in advance.

if you read though the thread you would of found the answer for that particular error, I just forgot to add it to the op.
 

BenLM

Member
Newcomer
Joined
Sep 1, 2018
Messages
10
Trophies
0
Age
46
XP
63
Country
France
Thank you for those answers.

But I've seen this before and it doesn't work unless I put it in the right place.

Indeed I read the whole line of discussions but I speak very badly English and therefore I try to understand as I can.
So I dropped by and apologized. I'll install what I need and test it.
I hope I don't have to bother you anymore.
 
Last edited by BenLM,

mattytrog

You don`t want to listen to anything I say.
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Thank you for those answers.

But I've seen this before and it doesn't work unless I put it in the right place.

Indeed I read the whole line of discussions but I speak very badly English and therefore I try to understand as I can.
So I dropped by and apologized. I'll install what I need and test it.
I hope I don't have to bother you anymore.

You need to download the zip from github, then add the ZIP to library. There is an option in the IDE.

--------------------- MERGED ---------------------------

here you go ladies and gents.

2 versions of the multi payload for the trinket & gemma.

manual and auto selection of the payloads.

multi 4 payload requires dat files on root of sd card.

triple payload requires the normal bin files placed in your normal place you have them.

example my bin files are in bootloader/payloads folder since v4.0 of hekate was released.

I've added a couple of links for the custom boot files to create the dat files and the payload files to drag and drop onto the trinket or gemma.

the auto payload ones may work on the R4 dongle and sx gear once it gets released.

have not tested on the r4 dongle as I don't have one,



these are just Edited versions of one of mattytrogs codes he posted in his thread, so thanks to him and the original source for the codes.

these are just aimed at dongles really.

for the multi 4 payload you can mix the dat files around to the order you rather have.

just make sure you name them correct to boot in the order you want.

example default

sxos 0001
hekate 0002
ReiNX 0003
RajNX 0004.

change to what you want.
example
hekate 0001
ReiNX 0002
briccmii 0003
memloader 0004

I will see about getting an R4 dongle to try sort multi files out for that if none ave been done.

but it's not on my priority list.

plus if anyone has any idea what can be used that has bigger flash than a trinket then feel free to let me know, that's more for my personal use as I want multi payload but not using dat files.



if you read though the thread you would of found the answer for that particular error, I just forgot to add it to the op.


The itsybitsy has some onboard SPI flash(2mb), and while it works fine, its a right pain to flash it, then flash the code.

So... Options...

Use the multi-payload (with the 3 payloads). I can do you a custom version if you like if you tell me your requirements.
ShaX multipayload that you use in the earlier posts
Use Hekate to launch other payloads.

If I get some time over the weekend, I`ll make a drag-and-drop version, so you can just add the bin file and its converted onboard the trinket.
 

BenLM

Member
Newcomer
Joined
Sep 1, 2018
Messages
10
Trophies
0
Age
46
XP
63
Country
France
You need to download the zip from github, then add the ZIP to library. There is an option in the IDE.

Thanks, but that's a mistake:

exit status 1
Compiling error for Adafruit Trinket M0 card


But I just want to use the SXos and not the multi
 

mattytrog

You don`t want to listen to anything I say.
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Thanks, but that's a mistake:

exit status 1
Compiling error for Adafruit Trinket M0 card


But I just want to use the SXos and not the multi
You need
Thanks, but that's a mistake:

exit status 1
Compiling error for Adafruit Trinket M0 card


But I just want to use the SXos and not the multi

You need the dotstar lib for all versions.

Just download this and drag the UF2 file over...

https://github.com/mattytrog/SAMD-Fusee-Launcher/tree/master/Trinket/TRINKET_newmethod123_SXOS/UF2
 
  • Like
Reactions: BenLM

M-O-B

Well-Known Member
OP
Member
Joined
Jun 23, 2018
Messages
281
Trophies
0
Age
54
XP
583
Country
United Kingdom
Thanks, but that's a mistake:

exit status 1
Compiling error for Adafruit Trinket M0 card


But I just want to use the SXos and not the multi

page 2 look for this post and do exactly what it says in the post.
Screenshot_20180902-080431_Chrome.jpg


--------------------- MERGED ---------------------------

You need to download the zip from github, then add the ZIP to library. There is an option in the IDE.

--------------------- MERGED ---------------------------



The itsybitsy has some onboard SPI flash(2mb), and while it works fine, its a right pain to flash it, then flash the code.

So... Options...

Use the multi-payload (with the 3 payloads). I can do you a custom version if you like if you tell me your requirements.
ShaX multipayload that you use in the earlier posts
Use Hekate to launch other payloads.

If I get some time over the weekend, I`ll make a drag-and-drop version, so you can just add the bin file and its converted onboard the trinket.

the files I have work just fine, the only issue is the flash size on the trinket, so am unable to actually flash 4 payloads, so I'm hoping to find something for my personal use with a bigger flash.

the new dongle code works rather well now weather it's manual payload selection or auto.

now I'm going to start on an internal code, but this will be for my personal use untill I'm completely satisfied that it's working 100% before I post the code.

again it will be 2 versions auto & manual but I putting no time scale on it as I have better things to do.
 

BenLM

Member
Newcomer
Joined
Sep 1, 2018
Messages
10
Trophies
0
Age
46
XP
63
Country
France
page 2 look for this post and do exactly what it says in the post. View attachment 141945

It's funny how you can be sure I didn't look....
I reread and installed the libraries that you give in link but nothing to do!
You have to stop thinking that everyone is the same....

You need the dotstar lib for all versions.

Just download this and drag the UF2 file over...

Thank you for your kindness and your help.
I will insist a little to understand why with arduino it does not pass.
I installed the libraries that you even give error.
Thanks bcp to you for your sympathy

--------------------- MERGED ---------------------------

page 2 look for this post and do exactly what it says in the post. View attachment 141945

And for your information :

upload_2018-9-2_9-45-13.png
 

M-O-B

Well-Known Member
OP
Member
Joined
Jun 23, 2018
Messages
281
Trophies
0
Age
54
XP
583
Country
United Kingdom
It's funny how you can be sure I didn't look....
I reread and installed the libraries that you give in link but nothing to do!
You have to stop thinking that everyone is the same....



Thank you for your kindness and your help.
I will insist a little to understand why with arduino it does not pass.
I installed the libraries that you even give error.
Thanks bcp to you for your sympathy

--------------------- MERGED ---------------------------



And for your information :

View attachment 141946

what file are you trying to use, also when the arduino software gives and error, you have a box that shows and will let you copy and paste the full error.

so click on that error message box to copy the full error, then paste it into notepad++

then you can paste the full error message in your next post, this would be better to understand the issue your having..

think you said you wanted sxos done so what I've done is compiled sxos drag and drop uf2 files, these will keep you going until you sort that error out.

these are compile from the codes in the op. plus one extra one I'm just finishing off.
 

Attachments

  • Trinket_Internal-v1.zip
    37.9 KB · Views: 152
  • Trinket_Dongle-v1.zip
    36.8 KB · Views: 158
  • Trinket_Dongle-v2.zip
    41.8 KB · Views: 173
  • Trinket-Gemma-R4_v5.zip
    38.1 KB · Views: 152

M-O-B

Well-Known Member
OP
Member
Joined
Jun 23, 2018
Messages
281
Trophies
0
Age
54
XP
583
Country
United Kingdom
some more dongle uf2 drag and drop files.

these will work on the R4 dongle and trinket and gemma these are individual payloads and ReiNX in compiled from the source this morning.

I will add these to the op once I sorted the multi payloads out. plus going to put most my time into an internal method now, as these ones will do for most if not all dongles..
 

Attachments

  • Sxos_UF2.zip
    38 KB · Views: 154
  • Hekate_4.0_UF2.zip
    106.6 KB · Views: 151
  • ReiNX_UF2.zip
    74.7 KB · Views: 163
  • RajNX_UF2.zip
    109.5 KB · Views: 148

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: :rofl2: