Tutorial  Updated

Trinket Internal Install.

Here's A Guide To Installing The Trinket M0 Into The Switch.

Program The Trinket Before You Remove The Usb Port, Saves You Doing It After You Complete The Install.

First Thing To Do Is Remove The Usb Port From The Trinket, If You Have A Hot Air Wand Then Use That To Remove The Port It Will Reduce The Risk Of Damage To The Pads.

usb intact.jpg


Now That The Usb Port Has Been Removed You Want To Solder Wire To The Data Pads, White = Data- And Green Data+ In This Guide.

Now Solder Wire To The Bat Pad = Red, Gnd Pad = Black, Pad 4 = Orange & Pad 3 = Brown In This Guide.

Also Remove The Resistor Next To The Ppower Led Mark Out In Purple In This Guide.
Trinket Points.jpg


When You Have The Trinket All Prepared, You Can Now Proceed To The Install To The Switch.
trinket install points.jpg


Once The Install Is Completely Done Then Clean Up The Points You Have Soldered To Using Isopropyl And Cotton Buds/Q-Tips.
Finished.jpg



Alternative Point For Pad 4.

Altternative Pad 4 Point.jpg


Alternative Points For Joycon Rail Pin 10.

If You Decide On Using This Alternative Point Then Use Enamel Coated Jumper Wire 0.10mm.

Alt Joycon Rail Pin 10 Point.jpg


Remember Take Your Time It's Not A Race lol. Rushing Can Lead To Mistakes.

Tools Required.

Kynar Wire 30 AWG.
Soldering Iron.
Hot Air Wand For Usb Port Removal(Optional)
Isopropyl.
Cotton Bud/Q-Tips.
Flux.
Solder.
Enamel Jumper Wire (Optional)


Thanks And Credit Goes To Xboxexpert For This Solution.

I Think That Covers Everything.

EDIT..

here's another method for the install of the trinket, this method does away with the pad 4, as some may find it tricky to solder to the cap used on the mobo.

the rst pad is used instead and the wire is linked to the power button, Also this has a bonus that you can double press the power button to put the trinket into boot loader mode for uploading a new payload.

of course you don't have to use the rst pad at all, you can't just press power button and volume up button, then press reset button for rcm mode.

this method should be ok for the novices.

install at your own risk.

another install.jpg


the pad on the power button to use.

power button point.jpg


i have one more method to try but I really think this one is not to bad method.

the more methods the better I say, of course to try and make it as easy as possible for pros and novices.

EDIT...
another method for the install of the trinket.

this method is basically same as all other methods, just a different points uses for the bat pad and rst pad.

this install will allow you to have the trinket power off when you fully power off the switch.

double press the reset button on the trinket to get into boot loader mode, this may take a couple of attempts to do.

the payload that you use already will work with this method no need for new ones.

here's the diagram for method 3, you could possibly have this as a 4 wire install, if you install auto rcm mode, but as my sd card module port is buggerd I couldn't test that out.

twinket power off.jpg


ok it seems method 3 needs auto rcm installed for it to work without the need to use the rst pad

so for them that don't want to use auto rcm mode then solder a wire from rst pad to the point on the power button, and use pad 3 to the pin 10 on the joycon rail or one of the alt points on mobo.

beware the alt points are small so use at your own risk.

ok anyone with changing issues test these 2 points, you should get 5v on the usb port side, and around 3.2v on the switch side.

if your getting the volts on the switch side that are fluctuating up & down then replace the part with the v on top it's a diode, you want one that fits so the actual size is either 0402 or 0603 in dimension (i'm using 0402/0603 as an example for size purpose only)

around page 16 has more info about this component..

dont come moaning if you damage your console doing this install, i'm not responsible for you opening or taking a soldering iron to your console.
you do this at your own risk any damage is down to yourself.


charger_issue_volts.jpg


another thing if your trinket starts to get very hot to the point you can't touch it, then the atmel ATSAMD21E18A-U ic is on it's way out, so you will need to replace the ic or just replace your trinket.

at some point it wont power up after this has happened.
1 = gets very hot.
2 = reset starts to become tempermental .
3 = dead
4 = fix replace the atmel ATSAMD21E18A-U ic

edit

added uf2 drag and drop files for r4 trinket gemma dongles or for a 4 wire internal install.

atmosphere
hekate 4.2
Sxos
rajnx
reinx
 

Attachments

Last edited by M-O-B, , Reason: added updated uf2 file.
@frep, how did you get on burning the bootloader?

I had a look on some forums and found you might need to set a fuse to enable the bootloader to be programmed. I'm still waiting for dev boards to turn up - so can't test this just now, but you could try setting this fuse in the openocd.cfg file

Code:
NVMCTRL_BOOTPROT = 0x7

See if that helps.

If that still fails, yoc can get a cheap programmer from ebay: j-link programmer
https://www.ebay.co.uk/itm/Brand-Ne...021834?hash=item2380847d4a:g:TLwAAOSwfQtbS~1b

Then use this guide: for programming a booloader
https://learn.adafruit.com/proper-s...-m0/restoring-bootloader#feather-m0-or-others

Hey MrDude
I wasn‘t successful with the rpi, but I tried the method, I mentioned with programming the bootloader using another m0 board, and that look like it works. I can‘t tell for sure, since there is no sign of life, once I connect the chip with my pc (no serial port shows up in the arduino ide).
I‘m not sure, where the error is. I tried the trinket bootloader and the arduino zero bootloader. Maybe the problem is that arduino zero has an external clock?
Im not quite sure what to try next... maybe you have an idea?
 
  • Like
Reactions: mrdude
Hey MrDude
I wasn‘t successful with the rpi, but I tried the method, I mentioned with programming the bootloader using another m0 board, and that look like it works. I can‘t tell for sure, since there is no sign of life, once I connect the chip with my pc (no serial port shows up in the arduino ide).
I‘m not sure, where the error is. I tried the trinket bootloader and the arduino zero bootloader. Maybe the problem is that arduino zero has an external clock?
Im not quite sure what to try next... maybe you have an idea?

Use you could flash the trinket bootloader instead- for testing, this doesn't need an external crystal fitted - that should rule that out if it's the problem.

Edit (Just noticed you've already tried that), Did you try locking the bootloader afterwards by setting the fuse to 0x1?

Also if you used the trinket bootloader - you should just have needed to connect D+ D- GND and Voltage(regulate to 3.3v) to your pc, it should have showed up just like a trinket on arduino ide, then you can flash the trinket code, afterwards it should show up as a drive.
 
Last edited by mrdude,
@frep,

As you're able to program the chip using the method you pointed to - you should also be able to dump the contents of the trinket booloader the same way - by reading the chip instead of programming:

1: Dump the bootloader of your trinket
2: Flash the dumped bootlader to you samd21
3: Dump the bootloader of the samd21

Compare both dumps - then binary compare them to the orignal bootloader you downloaded, that way you'll know if the programmer is working correctly and you're flashing the samd21 correctly.

You can use ultracompare to check these in binary mode :
https://www.ultraedit.com/products/ultracompare/

(if you need help unlocking that program let me know)
 
Last edited by mrdude,
  • Like
Reactions: frep
@frep,

As you're able to program the chip using the method you pointed to - you should also be able to dump the contents of the trinket booloader the same way - by reading the chip instead of programming:

1: Dump the bootloader of your trinket
2: Flash the dumped bootlader to you samd21
3: Dump the bootloader of the samd21

Compare both dumps - then binary compare them to the orignal bootloader you downloaded, that way you'll know if the programmer is working correctly and you're flashing the samd21 correctly.

You can use ultracompare to check these in binary mode :
https://www.ultraedit.com/products/ultracompare/

(if you need help unlocking that program let me know)

Thanks, I will give a try tonight!
 
@frep, how did you get on burning the bootloader?

I had a look on some forums and found you might need to set a fuse to enable the bootloader to be programmed. I'm still waiting for dev boards to turn up - so can't test this just now, but you could try setting this fuse in the openocd.cfg file

Code:
NVMCTRL_BOOTPROT = 0x7

See if that helps.

If that still fails, you can get a cheap programmer from ebay: j-link programmer (not sure if clones work in swd mode, clones might only work in jtag mode)

Then use this guide: for programming a booloader
https://learn.adafruit.com/proper-s...-m0/restoring-bootloader#feather-m0-or-others

After spending quite some time reading about arduino bootloader (especially uf2 bootloaders) I see no reason, why the trinket bootloader not should have worked, if it was put on the chip correctly. After reading your post again, I saw your tip about
Code:
NVMCTRL_BOOTPROT = 0x7
It is possible, the bootloader protection was not properly removed, and the raspberry pi told me that at least.
I will go back again to the rpi and have another try with your mentioned option!
 
After spending quite some time reading about arduino bootloader (especially uf2 bootloaders) I see no reason, why the trinket bootloader not should have worked, if it was put on the chip correctly. After reading your post again, I saw your tip about
Code:
NVMCTRL_BOOTPROT = 0x7
It is possible, the bootloader protection was not properly removed, and the raspberry pi told me that at least.
I will go back again to the rpi and have another try with your mentioned option!

I'm not sure that's the proper command for openocd - you'll need to look in the documentation for setting the fuses - I would have thought they came from the factory unlocked, if you look on google for 'NVMCTRL_BOOTPROT = 0x7', you'll see various posts on different forums about needing to set that fuse so you can program properly.

If you're just dumping the code, you won't need to set the fuse - hence saying to compare a dumped bootloader with the one you downloaded to see if they match up properly, if they do you've programmed the chip properly.
 
So i tried to install my trinket,
completely forgot to remove the resistor from the trinket(next to led)
could this have bricked my console? it booted ONCE with the BOOT.DAT? pic and then i powered it off, plugged in my SD and it never booted again.
I can hear a buzzing sound when i press the power button. Does not connect via PC, completely removed the trinket but same thing.
did i fry the M92T36 chip?
edit:
So after looking at a few other installs, seems its not compulsory to remove the resistor.
After thinking about it, anyone know how to diagnose the M92T36 chip? I think i may have bridged a lead when turning the switch over to power it off, or i may have even left the battery plugged in while soldering. I have a rework station, but I dont want to spend another $20 on the IC if I am just going to have to buy another switch.
 

Attachments

  • 20180721_172716.jpg
    20180721_172716.jpg
    1.5 MB · Views: 235
Last edited by Muta,
Since I needed a break from the bootloader problems, I went on testing the circuit using a modified trinket (lifted Enable-Pin of the voltage-regulator and connected it to the breadboard).
The circuit worked quite as it should! :-D
No matter what key is pressed, the trinket stays powered off, until both buttons (power and vol+) are pressed, after that, the trinket keeps itself powered on (until the program would set the pin low, after finishing loading the payload or so...).
Even there are still some issues with getting the bootloader on the chip, this tests make me confident enough to finish the pcb-design and order some boards during next week.
(Its a busy week, so not that much time left for this...)
 
  • Like
Reactions: mrdude
So i tried to install my trinket,
completely forgot to remove the resistor from the trinket(next to led)
could this have bricked my console? it booted ONCE with the BOOT.DAT? pic and then i powered it off, plugged in my SD and it never booted again.
I can hear a buzzing sound when i press the power button. Does not connect via PC, completely removed the trinket but same thing.
did i fry the M92T36 chip?
edit:
So after looking at a few other installs, seems its not compulsory to remove the resistor.
After thinking about it, anyone know how to diagnose the M92T36 chip? I think i may have bridged a lead when turning the switch over to power it off, or i may have even left the battery plugged in while soldering. I have a rework station, but I dont want to spend another $20 on the IC if I am just going to have to buy another switch.

clean up around the chip so no flux is left, then you'll get a better idea if anything is bridged.

another thing to try is charge up your switch just in case it's gone flat.

hold power button for 12 to 15 seconds to see if it either it fully shuts down or starts up.

not removing the led ain't the reason for issues, you don't have to remove it if you don't want to.

forget about the install until you have it powering back up.

then you can reinstall the trinket.
 
Since I needed a break from the bootloader problems, I went on testing the circuit using a modified trinket (lifted Enable-Pin of the voltage-regulator and connected it to the breadboard).
The circuit worked quite as it should! :-D
No matter what key is pressed, the trinket stays powered off, until both buttons (power and vol+) are pressed, after that, the trinket keeps itself powered on (until the program would set the pin low, after finishing loading the payload or so...).
Even there are still some issues with getting the bootloader on the chip, this tests make me confident enough to finish the pcb-design and order some boards during next week.
(Its a busy week, so not that much time left for this...)

Sweet, that's good news - I had a good idea that circuit would work fine, I could understand the circuit no problem, but it's good you tested and everything went according to plan. As soon as my dev boards come - I'll be on the case for programming the chip bootloader myself. Did you try dumping the chip once you'd flashed it + comparing with the bin file ? They should be the same. If I have success when my boards come - I'll do a tutorial or I can probably send you a couple of programmed chips, see how it goes first though.
 
Last edited by mrdude,
Sweet, that's good news - I had a good idea that circuit would work fine, I could understand the circuit no problem, but it's good you tested and everything went according to plan. As soon as my dev boards come - I'll be on the case for programming the chip bootloader myself. Did you try dumping the chip once you'd flashed it + comparing with the bin file ? They should be the same. If I have success when my boards come - I'll do a tutorial or I can probably send you a couple of programmed chips, see how it goes first though.

I have ordered a cheap j-link programmer from adafruit, so I wait until it arrives to look further into the bootloader.
 
  • Like
Reactions: mrdude
Hi, with the release of the cfw reynx I'm planning to install à M0 in my switch that is totally virgin from any hack.

If I apply this tutorial I will be able to launch the cfw ?

Do I need to flash the M0 with another file or the one in the package will be ok ?

If I understand the cfw it self will be on microsd and the trinket its to launch the rcm mode, then launch a payload that will be the cfw its self , do I have understand ?

In the 3 method of install witch will be the best ? I'm not afraid of small solders I have a lot of Rgh and jailbreak with teensy done.
 
@frep
I was looking at the Raspberry pi code for openocd.cfg and noticed there's a typo in it.

In the programming part:
Code:
program samd21_sam_ba verify

It should be
Code:
program samd21_sam_ba.bin verify

That could explain why you're having problems with the raspberry pi - as the config file is not telling what bin file to program with.
 
  • Like
Reactions: Deleted User
Wonder if I should cancel my switchMe REBUG or get me a trinket M0

Aside from a few bugs, trinket M0 is working pretty great from what I read

My only concerning is draining battery while off
 

Site & Scene News

Popular threads in this forum