Hacking DEAD [Shutdown]DragonInjector - Game Cart Payload Injector (Trinket M0 Clone)

Status
Not open for further replies.

MatinatorX

Hardware Developer
OP
Developer
Joined
Jul 17, 2018
Messages
366
Trophies
1
Website
www.dragoninjector.com
XP
2,538
Country
Canada
Quick update: battery test stream went well - we saw way over the previous injection count, with about 1350 injections on a single Energizer CR1216 battery! This should last most people well over a year, and with the auto-power off now working great and button cell batteries having incredible shelf life, battery drain when not in use should be almost nonexistent.

So, what's next?

The sticker design is done, but I still have to finish the case art. I want to have that done by the end of this week, with stickers, art, and cases themselves being ordered on Friday. This weekend will be spend building the tester units.

I wanted to send the tester units out this week, but it wouldn't really be fair to send them out without the stickers, case and art insert. I will be waiting until those arrive so I can send the testers a complete package. Also, this means I can still get a solid 6 hours of sleep this week.

I've decided to forgo having a separate case design for the buttonless version, and instead just provide two stickers with each DragonInjector - one with and one without holes and labels for the buttons. This simplifies assembly and the user can then decide which sticker they want to apply. The buttons will just be hidden behind the sticker, but it will end up looking the same as if I omitted them completely. It also means I don't have to have two different products to keep track of. As the buttons will likely be a feature used by those a little deeper into the Switch scene, the DragonInjector will ship with ArgonNX preloaded, with instructions on how to swap to @mattytrog 's firmware written inside the art insert.

The firmware for the "buttonless" version is done except for the low battery check. I'd like to have both firmwares tested and working by early next week, with a video of each posted to the YouTube channel I created because Discord has a 40mb upload limit in 2019 for some reason. You can find it here: https://www.youtube.com/channel/UCbq2Mc-UeaTiMOJ--NiQ_-Q

Thanks again everyone for the kind words and support!

20190121_074633.jpg
 

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
Quick update: battery test stream went well - we saw way over the previous injection count, with about 1350 injections on a single Energizer CR1216 battery! This should last most people well over a year, and with the auto-power off now working great and button cell batteries having incredible shelf life, battery drain when not in use should be almost nonexistent.

So, what's next?

The sticker design is done, but I still have to finish the case art. I want to have that done by the end of this week, with stickers, art, and cases themselves being ordered on Friday. This weekend will be spend building the tester units.

I wanted to send the tester units out this week, but it wouldn't really be fair to send them out without the stickers, case and art insert. I will be waiting until those arrive so I can send the testers a complete package. Also, this means I can still get a solid 6 hours of sleep this week.

I've decided to forgo having a separate case design for the buttonless version, and instead just provide two stickers with each DragonInjector - one with and one without holes and labels for the buttons. This simplifies assembly and the user can then decide which sticker they want to apply. The buttons will just be hidden behind the sticker, but it will end up looking the same as if I omitted them completely. It also means I don't have to have two different products to keep track of. As the buttons will likely be a feature used by those a little deeper into the Switch scene, the DragonInjector will ship with ArgonNX preloaded, with instructions on how to swap to @mattytrog 's firmware written inside the art insert.

The firmware for the "buttonless" version is done except for the low battery check. I'd like to have both firmwares tested and working by early next week, with a video of each posted to the YouTube channel I created because Discord has a 40mb upload limit in 2019 for some reason. You can find it here: https://www.youtube.com/channel/UCbq2Mc-UeaTiMOJ--NiQ_-Q

Thanks again everyone for the kind words and support!

View attachment 155912
Well done sir!

What pin are you using for LED?

Time to add support for it in Simple-UF2 unless Trinket is correct already :)
 
  • Like
Reactions: Adran_Marit

MatinatorX

Hardware Developer
OP
Developer
Joined
Jul 17, 2018
Messages
366
Trophies
1
Website
www.dragoninjector.com
XP
2,538
Country
Canada
Well done sir!

What pin are you using for LED?

Time to add support for it in Simple-UF2 unless Trinket is correct already :)

Praise from the master themself, thanks buddy! :lol:

Pinout is as follows, but I had planned to modify your code instead of asking you to do the work so don't feel obligated in any way. :P

LED is a 1mm x 1mm RGB LED (bugger to hand solder) and is common anode, so lines must be pulled low to turn on and high to turn off.

D7 = Red
D8 = Green
D2 = Blue

I have D0 (the + button) accepting 3.3v through S1 whenever pressed which also turns on LDO to wake up the MCU. The idea is whenever the MCU starts, it checks to see if D0 is HIGH, and if so it increments the payload number, writes it to eeprom, skips injection, blinks blue to indicate the number of the payload selected then goes to sleep. The idea is to hold the button until the LED stops flashing.

Also have A0 reading battery voltage through a voltage divider. R1 is 2.5MΩ and R2 is 1MΩ, which converts 0-3.85v from battery to 0-1.1v at A0 to match the internal 1.1v reference of the ATSAMD21. The plan is to have a low battery LED indication of 0.5 seconds on boot. I have yet to map out the voltages I want to use for battery status, but colors would be green for healthy, yellow for warning and red for critical battery level. On red I would skip injection and just flash red a few times before putting MCU to sleep. Reason being, injection can fail if voltage is too low, which causes the Switch to freeze, requiring a 20sec power button shutdown. Advanced users who want to risk it for a few more injections can modify the firmware. ;)

Schemmy attached. I've been told my schematics look awful, so sorry about that. :lol:
 

Attachments

  • V14.png
    V14.png
    28.9 KB · Views: 131
Last edited by MatinatorX,

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
Praise from the master themself, thanks buddy! :lol:

Pinout is as follows, but I had planned to modify your code instead of asking you to do the work so don't feel obligated in any way. :P

LED is a 1mm x 1mm RGB LED (bugger to hand solder) and is common anode, so lines must be pulled low to turn on and high to turn off.

D7 = Red
D8 = Green
D2 = Blue

I have D0 (the + button) accepting 3.3v through S1 whenever pressed which also turns on LDO to wake up the MCU. The idea is whenever the MCU starts, it checks to see if D0 is HIGH, and if so it increments the payload number, writes it to eeprom, skips injection, blinks blue to indicate the number of the payload selected then goes to sleep. The idea is to hold the button until the LED stops flashing.

Also have A0 reading battery voltage through a voltage divider. R1 is 2.5MΩ and R2 is1MΩ, which converts 0-3.85v from battery to 0-1.1v at A0 to match the internal 1.1v reference of the ATSAMD21. The plan is to have a low battery LED indication of 0.5 seconds on boot. I have yet to map out the voltages I want to use for battery status, but colors would be green for healthy, yellow for warning and red for critical battery level. On red I would skip injection and just flash red a few times before putting MCU to sleep. Reason being, injection can fail if voltage is too low, which causes the Switch to freeze, requiring a 20sec power button shutdown. Advanced users who want to risk it for a few more injections can modify the firmware. ;)

Schemmy attached. I've been told my schematics look awful, so sorry about that. :lol:

Thank-you sir!

I go off the Atmel pin numbers but I`ll sort that!

Will work on it when I got my lad in bed. I love your device!
 

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
Well aren't you fancy then. :lol:

D7 = PA00
D8 = PA01
D2 = PA09
D0 = PA08
A0 = PA02

Thanks for the kind words! I love your firmware. :D
Fancy? Nah...

Just making a JSON and variant files for armoured-dildo (arduino)

What PID / VID are you using sir? Your own or trinket / gemma / sparkfun whatever?

EDIT: Don`t matter. Solved ;)
 
Last edited by mattytrog,

MatinatorX

Hardware Developer
OP
Developer
Joined
Jul 17, 2018
Messages
366
Trophies
1
Website
www.dragoninjector.com
XP
2,538
Country
Canada
Fancy? Nah...

Just making a JSON and variant files for armoured-dildo (arduino)

What PID / VID are you using sir? Your own or trinket / gemma / sparkfun whatever?

EDIT: Don`t matter. Solved ;)

I'm still flashing the stock Trinket M0 Arduino bootloader with OpenOCD, haven't had time to mess with it yet, so VID and PID will be the Trinket M0 one still. Eventually I want to rename the flash drive to DRAGONBOOT and put the code for the battery indicator light in there too, but I haven't had the chance to mess with it yet. Do you know if it's possible to update the bootloader through Arduino or the UF2 files?
 
Last edited by MatinatorX,

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
@Pixel


I'm still flashing the stock Trinket M0 Arduino bootloader with OpenOCD, haven't had time to mess with it yet, so VID and PID will be the Trinket M0 one still. Eventually I want to rename the flash drive to DRAGONBOOT and put the code for the battery indicator light in there too, but I haven't had the chance to mess with it yet. Do you know if it's possible to update the bootloader through Arduino or the UF2 files?

Use UF2 files ;)
 

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
So... Going to work on battery voltage routines tonight.

The SAMD21 tends to drop out at about 2.2v (I think if I remember correctly)

So, looking at the 1216 discharge curve here, I`d initially go for 2600mV amber, 2400mV red >>> shutdown

Will have a play throughout the evening :)

So, if we say (through the divider), 3000mV (1216 nominal v) / 1100mV (going to analogue pin) gives 2.72 as a ratio

If we apply that to the values above...

2600 / 2.72 = 955mV amber
2400 / 2.72 = 882mV red

Just to get us going... Right... Need to go digging for a rheostat in my box of shit now ;)

Not taking current into account yet with above figures.

Going to enjoy this.
 
Last edited by mattytrog,

MatinatorX

Hardware Developer
OP
Developer
Joined
Jul 17, 2018
Messages
366
Trophies
1
Website
www.dragoninjector.com
XP
2,538
Country
Canada
So... Going to work on battery voltage routines tonight.

The SAMD21 tends to drop out at about 2.2v (I think if I remember correctly)

So, looking at the 1216 discharge curve here, I`d initially go for 2600mV amber, 2400mV red >>> shutdown

Will have a play throughout the evening :)

So, if we say (through the divider), 3000mV (1216 nominal v) / 1100mV (going to analogue pin) gives 2.72 as a ratio

If we apply that to the values above...

2600 / 2.72 = 955mV amber
2400 / 2.72 = 882mV red

Just to get us going... Right... Need to go digging for a rheostat in my box of shit now ;)

Not taking current into account yet with above figures.

Going to enjoy this.

I just want to note that my intention was to make less work for you, not more. But I am sincerely glad you're enjoying it. :rofl:

I really do appreciate the help. My plan was going to be to stick my multimeter on GND and V and leave my Switch injecting payloads all night on video, then look at the video to see what the voltage was at 1000 injections and set that as amber, then again at 1200 injections and set that as red. (From testing I know that we average 1300-1350 injections on a single CR1216.)

I'm not sure that the 2.2V brownout threshold will be an accurate representation of "0 percent" battery life though, since the ATSAMD21 is only capable of Full Speed USB and not High Speed USB, which (as I understand it, I could be very wrong) uses different rules for a logical 1 or 0. While High Speed USB only cares about a 200mV differential to indicate a logical 1 and 0, Full Speed USB has set values of 0.3v and 2.8v, above and below which act as a logical 0 or 1. While I think these values can probably be fudged a bit, in my tests, even when the ATSAMD21 itself is still operating just fine, once voltage drops below 2.7V injections start to fail.

I had also planned to read voltage before starting USB on the MCU, as there's a massive spike in current with USB on and it could easily fudge the readings. While injecting I observe 11-13mA of current but it's under 1mA when running with USB off.

Anyways, if I haven't said it enough, I really do appreciate the help as my free time is severely limited and everyone has been way too p[atient waiting for me to deliver. Cheers! :grog:
 
Last edited by MatinatorX,
  • Like
Reactions: TheZoc

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
I just want to note that my intention was to make less work for you, not more. But I am sincerely glad you're enjoying it. :rofl:

I really do appreciate the help. My plan was going to be to stick my multimeter on GND and V and leave my Switch injecting payloads all night on video, then look at the video to see what the voltage was at 1000 injections and set that as amber, then again at 1200 injections and set that as red. (From testing I know that we average 1300-1350 injections on a single CR1216.)

I'm not sure that the 2.2V brownout threshold will be an accurate representation of "0 percent" battery life though, since the ATSAMD21 is only capable of Full Speed USB and not High Speed USB, which (as I understand it, I could be very wrong) uses different rules for a logical 1 or 0. While High Speed USB only cares about a 200mV differential to indicate a logical 1 and 0, Full Speed USB has set values of 0.3v and 2.8v, above and below which act as a logical 0 or 1. While I think these values can probably be fudged a bit, in my tests, even when the ATSAMD21 itself is still operating just fine, once voltage drops below 2.7V injections start to fail.

I had also planned to read voltage before starting USB on the MCU, as there's a massive spike in current with USB on and it could easily fudge the readings. While injecting I observe 11-13mA of current but it's under 1mA when running with USB off.

Anyways, if I haven't said it enough, I really do appreciate the help as my free time is severely limited and everyone has been way too p[atient waiting for me to deliver. Cheers! :grog:
Fair enough mate. You know your device.

Written battery code... Thought I had a 10k rheostat in my boxes of crap but nope. Time to strip an old radio tomorrow.

I like your potential divider idea

No the 2.2v isn`t accurate at all. That was the voltage the thing actually started locking up in deep sleep.

Was just a figure I had in my very-bad-sectored brain. I think that was actually the brownout for the LDO on the trinket thinking about it some more.

My notes are in the workshop / shed / secret whiskey drinking hole and I`m bloody frozen. Can`t get warm. So I`ll go over them tomorrow.

So, in the meantime, just put another feature into my Franken-Hekate. Backup prodinfo only. If people are too impatient for a full dump.

Will be in 0.9.7 of Simple-UF2.

It`s nice having something to do!
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://youtu.be/MddR6PTmGKg?si=mU2EO5hoE7XXSbSr