Hacking COMPLETED BASIC MODCHIP / DONGLE UF2 SD BOOT FILES. Trinket / Rebug / RCMX86 / Others

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
New Simple-UF2 thread being created. All my threads seem to get cluttered, so I am in the process of making a new one. Link will be HERE when ready.


Introduction

What is this?


In this thread are a selection of different files (mostly UF2s) that hopefully will assist modchip fitters in launching payloads from SD.

Why the need?

The defacto Switch modchip standard, has become the microcontrollers based on ARM Cortex M0. Most of these are the Atmel SAMD21 line of chips.
These chips incorporate a bootloader that allow the microcontroller to be flashed from the computer without any complicated flashing hardware / jtag etc. This is accomplished by using the Microsoft UF2 standard. UF2 files tell the chip how to flash itself and also provide the firmware you will flash to the chip. So, flashing the chip is as simple as drag-and-dropping a UF2 file into a drive.

If you press RESET TWICE in quick succession, the bootloader on the microcontroller will trigger UF2 update mode, and a USB drive will open. It will look just like any regular USB flash drive. It should be noted that it isn`t. It just looks like one.

This drive should be called "<something>BOOT". ie TRINKETBOOT, REBUGBOOT, ITSYBOOT etc etc.

Now... The modchip in the switch is there to push a payload in RCM mode as we should all know. But we cannot just drag a payload to the chip and expect the chip to know what to do with it.

We need a version of the Fusee launcher that runs on these chips. (We normally run TegraRCMsmash via a PC - which is itself Fusee, and with that, we select our payload to push (could be Hekate / reiNX / SXOS whatever).

In the past we had to open Arduino IDE and convert our payload to a C array and build it into the actual chip firmware. We have to do this because the UF2 drive on the chip I mentioned, contains data and firmware to flash the chip. You cannot just add a "hekate.bin" to your TRINKETBOOT drive and expect it to work as the chip will not understand this.

So we need a way to run Hekate.bin for example from SD card. Thats what these files are for.

Quantum_cross & Atlas44 wrote the first SAMD fusee launcher back in April / May, but in that time, it has been built upon and (hopefully?) improved until we are where we at now.

New features added include:

  • Dropping of straps
  • Customising of times for searching / dropping straps
  • Flash Storage facility added to remember key settings
  • Multiple-payload facility
  • Mode switch option
  • Other improvements regarding startup / shutdown
  • Modified UF2 bootloader that automatically emulates both "straps" WITHOUT battery drain. This had to be done in the bootloader as otherwise it just was not fast enough. More on that later...


Step 1. Identify Your Device / Installation Method
This may be obvious. You NEED to know this. If you don`t know, check with your modchip fitter. If your modchip fitter isn`t around, PM me.

Once you have this information, remember it.


Step 2. What do you want your modchip to do?
Simplest answer... Push payloads! However there is more...


In the UF2 file you will download in a moment, there is a built-in standard version of Hekate. There is also support for multi-payload modes, single payload modes (that don`t require the Arduino IDE) and more.

If you want to run Hekate, bog standard, the way CTCAer intended, you need to download "mode1.UF2". Download in Step 3.

If you do not want to run Hekate by default, then use "mode2.UF2" in Step 3 v0.8.1 download.

If you want multiple payload modes, get yourself a piece of wire or something (about 3 inches long?). We will be shorting a pin/pad on our modchip.

***TL;DR Note for experienced users of my garbage... The UF2s above are identical. Just in different modes. Mode1.UF2 is in... Have a guess... And Mode2.UF2 is in Mode 2. Mode table being updated...

HERE is a pin table showing correct pins and their connections / functions



Step 3. Download the latest release...

Mode Table is available HERE (PDF)
All-In-One-UF2
Latest release HERE

v0.8.2

Changelog:
  • Hekate 4.5 update
Want to make your own "nx" files? Download this... BootDatConverter (windows version)


Step 3a. Basic UF2 files. ***NEW
If you are after a basic setup, no messing around, try this... Choose one...


Bootloaders altered slightly...
Changelog:

  • Strap pulse of 100mS to trigger RCM in non-autoRCM use cases.
  • INFO_UF2.TXT in your modchip (SWITCHBOOT) will tell you what version and what straps are being dropped if you are ever unsure.

Trinket M0 / Rebug SwitchME
Trinket M0 - Quantum_Cross / Atlas44 install method (legacy method 3) - basic UF2 only
Trinket M0 - Mattytrog (newer method 3) - basic UF2 only

Gemma M0
ItsyBitsy M0
Feather M0 Express
NS-Atmosphere (bin file - upload with programmer)
R4S **coming
RCMX86 Dongle **coming

*****
Sleep Mode Libraries etc

You will also need THESE if you plan on using Hekate 4.5. Place all bso files into bootloader/sys, See hekate thread for more info
*****

In the above download links are 3 files in a zip folder. All begin with Step_1 or Step_2 (apart from the method 3 files)

Download your chosen chip and drag the Step_2 UF2 to your device (or the one UF2 if using a method 3 file) (see below)

This is quite simple... Your device will look for "payload.bin" or "start.bin" in root of SD folder. If found, it will boot it automatically. If not found, it will boot Hekate. Thats all.

All modes etc are intact (again...See below) but this is the default basic simplest solution. No NX files are required. No 0 folder required. Just your payload. Called "start.bin" or "payload.bin".

Step_1 are bootloader files. Flash one of these if you wish. These are for internal fitted chips.



Step 4. Installing UF2 file to device

All adafruit boards / Rebug boards - Fitted into console
If your modchip is fitted to your console, follow these steps:

1) Allow a normal boot. Or a CFW boot. You MUST be booted into the Switch OS (Horizon)
2) Disconnect any cables you may have connected to your switch
3) Press the RESET button on your console twice. If you are using the SWITCHBOOT bootloaders, you will have to leave a 1 second delay between presses.
4) If done correctly, the LED should "breathe" - get brighter and dimmer. If you see this, plug your switch console into your PC. A drive will open that contains "CURRENT.UF2". If you do not see this, go back to step 2 and try again.
5) Drag your "mode1.UF2" or "mode2.UF2" to this drive. It will copy over, then the drive will close. Your chip is now flashed.

All adafruit boards - Not yet fitted to console
If your chip has a USB port fitted and you have not installed it to youtr console yet, follow these steps.
1) Plug your chip into your computer via micro-USB cable.
2) A drive should open as indicated in step 4 above.
3) Follow step 5 above. Your chip is now flashed. Now fit it.

Step 5a. If using Hekate mode, you are finished. Boot your console with an SD inserted and a "Bootloader" folder will be made. Get your sleep library (bso file) if needed from the Hekate git.


Step 5b. If using "mode 2" or any other mode that requires 0 folder / nx files, you will need the 0 folder which is in the download archive you downloaded in step 3. Extract this to SD card root.
You should have a 0 folder on the root of your SD. Go in to it, you should see some "nx" files. These are forwarders.


Step 6. Functions of files and pins...

In the 0 folder...

You will see a folder called unusedNXfiles. The idea is, you copy your selected "unused" file to where the rest of the nx files are and replace it. Thats why there is a zipped backup file.

atmosphere_rename_to_1.nx - This is Atmosphere fusee-primary. If you have this, there is NO NEED to have fusee-primary on your card. You only need fusee-secondary, BCT.ini and the Atmosphere folder. This is here, as due to a problem (Looks to be hwinit related) fusee-primary boots to a black screen if using as "start.bin" for example. try it.


hekate_rename_to_1.nx - This is Hekate. Standard. Pointless really as it is built-in to UF2. Oh well...


startbin_in_sd_root_rename_to_1.nx - This is the same as the standard 1.nx, APART FROM instead of placing "start.bin" in 0 folder, you can place in SD card root. Example... You want SXOS... If you use this file, you put payload.bin, boot.dat, licence.dat in root of SD.

Pins...


Remember that pin table you saw earlier? THIS one?
This is what those pins do. I`m not including the Joycon / Vol+ pins as we should already know what these are for...

Cycle mode / payloads - Touch this to ground, the chip will begin to cycle through the different modes. Touch this go GND again to select. If selecting a "multi-payload" mode, the payloads will be cycled. Touch to GND again to select your payload. Chip will save and reboot. Disabled at the moment. There is a better way of doing it.

Increase mode - Exactly what it says... Touch to GND to increase the mode counter by one.

Increase payload - Exactly what it says. Increases payload counter by one.



Some Scenarios...

These are example scenarios that may or may not apply to you... Just to give you an idea...

Q - I want to run Hekate. No multi-payload / 0 folder nonsense. Just a plain version of Hekate in a UF2. Can I?


A - Yes. Just download a "mode1" UF2. Drag that over... Done. A bootloader folder will either be made if one doesn`t exist, or will use your existing one.

Q - I just want to run the one payload. Chop and change as I wish. Can I?

A - Yes. Just use the 0 folder (you only need 1.nx) and name your payload "start.bin" and place in 0 folder. Or use the other 1.nx which looks for "start.bin" in SD root. No UF2 conversion / hex-editing necessary.

Q - I downloaded an old UF2 of yours. It used these things called "s2" files. Are these still valid?

A - Yes. No real reason to change. If you want to run the latest Hekate 4.5 or whatever, just put the Hekate file where you normally put your payloads (0 folder / SD root) and rename. You can still run all your payloads. I changed it for clarity really. And it was easier to make a failure / indication graphic. Update if you wish. Just make sure you update your 0 folder too. Its all a drag and drop exercise.

Q - Isn`t all this a bit "complicated" for what it does?

A - Maybe. But I think it is easy enough. This was actually meant for people who want to make their own dongle or whatever.




Version 2 - Old version of the ShaXLauncher. For your records only. Discontinued.

I won`t bother updating this one anymore, but I will leave it on my Git until the end of time for people who used the s2 version, with the s2 files.
Both versions are similar actually. But here they are...

Trinket / Rebug SWITCHME All Methods
Trinket Legacy 3 version (quantum_cross / atlas44)
Gemma M0
Itsybitsy M0

The "0 folder" is in each modchips folder above.

People can use this if they wish, but I am no longer supporting it.
The straps are enabled in the firmware for this version, so if you are using the new bootloader modification, use the new files too.
UF2s / source always wanted to support new dongles / boards. PM or put in thread.

Good luck!
 

Attachments

  • ns-atmosphere.zip
    10 KB · Views: 908
  • pintable1.pdf
    21.7 KB · Views: 950
  • modetable6version.pdf
    21.4 KB · Views: 887
  • feather_m0_express_bootloaders.zip
    143.1 KB · Views: 362
  • gemma_bootloaders.zip
    142.8 KB · Views: 327
  • Trinket_Legacy3.zip
    127.8 KB · Views: 455
  • itsybitsy_bootloaders.zip
    142.9 KB · Views: 322
  • Trinket_Method3.zip
    127.8 KB · Views: 625
  • trinket_rebug_bootloaders.zip
    142.9 KB · Views: 850
  • hekate_start.zip
    81.6 KB · Views: 932
  • sleep-library etc.zip
    45 KB · Views: 400
Last edited by mattytrog,

Canna

Bad Ass Poisonous Mushroom
Member
Joined
Jul 14, 2018
Messages
1,396
Trophies
0
Age
36
Location
AZ
XP
1,539
Country
United States
First.....

Great job Fatboy,
Im still using one of your old gemma sxos :P
il update when or if they change there payload..
 
  • Like
Reactions: mattytrog

Maupiti

Hacking is so « Nice »
Member
Joined
Sep 16, 2018
Messages
1,037
Trophies
0
XP
2,417
Country
France
Thanks for the great job @mattytrog , a question, I ´m planning to build my own trinket based dongle (even if I already own an sx pro and everything running fine for multi-payloads) but I miss the D.I.Y ...

So I ´d like to buildi a version with the ability of 3 different payloads that are selected by pressing a momentary switch... If I understood well what I saw on other threads, for the trinket I need to ground (-) Pad 1

Power on (Cr2032 based), press reset (1 or 2 times ?), press one the switch for payload, and if I want the second payload, press reset again, then the switch again and so on ? And could you please point the link for this « multi payload « file ? I can’t remember which thread I saw it

Thank you very much
 

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Thanks for the great job @mattytrog , a question, I ´m planning to build my own trinket based dongle (even if I already own an sx pro and everything running fine for multi-payloads) but I miss the D.I.Y ...

So I ´d like to buildi a version with the ability of 3 different payloads that are selected by pressing a momentary switch... If I understood well what I saw on other threads, for the trinket I need to ground (-) Pad 1

Power on (Cr2032 based), press reset (1 or 2 times ?), press one the switch for payload, and if I want the second payload, press reset again, then the switch again and so on ? And could you please point the link for this « multi payload « file ? I can’t remember which thread I saw it

Thank you very much

In my other thread... https://gbatemp.net/threads/interna...ybitsy-m0-express-guide-files-support.508068/

All source is in my github. Can make you a custom one if you want.
 
  • Like
Reactions: Akira

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,769
Trophies
2
XP
28,010
Country
United Kingdom
Finally a plain chainloader, thanks. I thought it was funny that TX were the first to do it, so fair play for yoinking their stuff.

Another way I had in mind was tearing down the latest hekate source to just do all its init and then call its payload chaining function, leaving out all the menus and other features. Have a crack at that if you fancy another project, but make sure you incorporate ctcaer's latest fix for loading sx os payload that was fixed since the 4.1 release.
 

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
Finally a plain chainloader, thanks. I thought it was funny that TX were the first to do it, so fair play for yoinking their stuff.

Another way I had in mind was tearing down the latest hekate source to just do all its init and then call its payload chaining function, leaving out all the menus and other features. Have a crack at that if you fancy another project, but make sure you incorporate ctcaer's latest fix for loading sx os payload that was fixed since the 4.1 release.

Thats all this is designed to be. Just plain-Jane .bin booting.

I will have a go with Hekate. But it felt kinda fun to "copy" from TX...
 
  • Like
Reactions: DayVeeBoi

Maupiti

Hacking is so « Nice »
Member
Joined
Sep 16, 2018
Messages
1,037
Trophies
0
XP
2,417
Country
France
In my other thread... https://gbatemp.net/threads/interna...ybitsy-m0-express-guide-files-support.508068/

All source is in my github. Can make you a custom one if you want.
That would be great :wub: , thank you so much...
After thinking about it, this should meet my needs :

A dualboot

1- Hekate (latest release) Colour Led Blue
2- Sx Os Colour Led Yellow

Auto increase on
Flash before send on

Again thank you, and as soon as I built my dongle, I will report and send some pictures in the dedicaded thread.
 
Last edited by Maupiti,

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
That would be great :wub: , thank you so much...
After thinking about it, this should meet my needs :

A dualboot
1- Hekate (latest release) Colour Led Blue
2- Sx Os Colour Led Yellow

Auto increase on
Flash before send on

Again thank you, and as soon as I built my dongle, I will report and send some pictures in the dedicaded thread.

Ok I'll do it as soon as I took my son to school. An hour or so.
 
Last edited by mattytrog,
  • Like
Reactions: Maupiti

mattytrog

You don`t want to listen to anything I say.
OP
Member
Joined
Apr 27, 2018
Messages
3,708
Trophies
0
Age
48
XP
4,328
Country
United Kingdom
That would be great :wub: , thank you so much...
After thinking about it, this should meet my needs :

A dualboot

1- Hekate (latest release) Colour Led Blue
2- Sx Os Colour Led Yellow

Auto increase on
Flash before send on

Again thank you, and as soon as I built my dongle, I will report and send some pictures in the dedicaded thread.

Here we go.
 

Attachments

  • hekatesxos_auto_flash_before_no_pin.zip
    123.9 KB · Views: 506
  • Like
Reactions: Maupiti

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    straferz @ straferz: Anybody know why this is happening to my ACWW town...