Hacking Question How to put back the Switch into shipping mode?

igoticecream

Well-Known Member
OP
Newcomer
Joined
Jul 6, 2018
Messages
55
Trophies
0
Age
36
XP
369
Country
Spain
Ok so turns out the switch still consume battery even if it's off. I'd like to store my backup vulnerable switch and preserve battery life.

I was digging in the forum and turns out that in order to put it back into shipping mode, one have to turn off BATFET. There's a function in CTCaer's hekate that can archive this (github[.]com/CTCaer/hekate/blob/master/ipl/bq24193.c#L149) and the code in the main that calls this is commented with a nasty warning that one could end up pluging back the battery manually (github[.]com/CTCaer/hekate/blob/master/ipl/main.c#L2331)

Is this the code that I'm looking for? Does anyone have successfully turned off BATFET with that piece of code and can confirm that plugging the adapter back connects the battery?
 

mariogamer

Well-Known Member
Member
Joined
Aug 12, 2015
Messages
1,256
Trophies
0
Age
28
XP
790
Country
Canada
Ok so turns out the switch still consume battery even if it's off. I'd like to store my backup vulnerable switch and preserve battery life.

I was digging in the forum and turns out that in order to put it back into shipping mode, one have to turn off BATFET. There's a function in CTCaer's hekate that can archive this (github[.]com/CTCaer/hekate/blob/master/ipl/bq24193.c#L149) and the code in the main that calls this is commented with a nasty warning that one could end up pluging back the battery manually (github[.]com/CTCaer/hekate/blob/master/ipl/main.c#L2331)

Is this the code that I'm looking for? Does anyone have successfully turned off BATFET with that piece of code and can confirm that plugging the adapter back connects the battery?
It's simpler than that. Turn it off using Hekate's Power off function. This turn off the SoC completely.

The BATFET thingy was a fix to the battery desync, by completely reseting the battery config, until natinusala&perillamint found out only a single value needed to be changed.
 
Last edited by mariogamer,

igoticecream

Well-Known Member
OP
Newcomer
Joined
Jul 6, 2018
Messages
55
Trophies
0
Age
36
XP
369
Country
Spain
The code of the hekate's Power off function doesnt seem to disconnect the battery, just a regular turn off like the physical button does
 

mariogamer

Well-Known Member
Member
Joined
Aug 12, 2015
Messages
1,256
Trophies
0
Age
28
XP
790
Country
Canada
The code of the function doesnt seem to disconnect the battery, just a regular turn off like the physical button does
Nvm actually, shipping mode is the BATFET thingy, sorry.

However the hekate power off doesn't power off like a normal one. It does power off more stuff.

And I can confirm too.
 
Last edited by mariogamer,

CTCaer

Developer
Developer
Joined
Mar 22, 2008
Messages
1,154
Trophies
0
XP
3,009
Country
Greece
@mariogamer
He asks for shipping mode.
The power off does not disable fuel gauge, battery charger and pmic completely.

The commented code with the BATFET disconnection is exactly what OP wants (shipping mode).
And to disable shipping mode you just connect the switch wall charger (although 2-3 users had problem with this).

The storage usage of this, should be like this:
Disable AutoRCM if on.
Charge to 3.75V.
Disconnect USB.
Run it. It will force shutoff.

To reenable:
Connect wall adapter.
If the voltage is lower than 3.2V, it will not turn on right away.

Edit:
The 3.75V is among the best storage voltages for 3.7V li-on batteries.
 
Last edited by CTCaer,

mariogamer

Well-Known Member
Member
Joined
Aug 12, 2015
Messages
1,256
Trophies
0
Age
28
XP
790
Country
Canada
@mariogamer
He asks for shipping mode.
The power off does not disable fuel gauge, battery charger and pmic completely.

The commented code with the BATFET disconnection is exactly what OP wants (shipping mode).
And to disable shipping mode you just connect the switch wall charger (although 2-3 users had problem with this).

The storage usage of this, should be like this:
Disable AutoRCM if on.
Charge to 3.75V.
Disconnect USB.
Run it. It will force shutoff.

To reenable:
Connect wall adapter.
If the voltage is lower than 3.2V, it will not turn on right away.
Yeah I edited my post already, sorry.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • S @ salazarcosplay:
    and also ahve the option to play as a human
  • S @ salazarcosplay:
    or set it up that when you get injured past a certain point they have to replace your human parts with cybernetics
  • Xdqwerty @ Xdqwerty:
    i have a placeholder enemy sprite i made
  • S @ salazarcosplay:
    or have it that you don't know you are a cyborg, robot, and you find out and have a existential crisis
  • S @ salazarcosplay:
    or have it start in the virtual world and you are an ai that gained sentience
  • Xdqwerty @ Xdqwerty:
    btw gonna wash my face in a bit, my eyes feel tired
  • S @ salazarcosplay:
    and you convince your owner to help you break out of the virtual world to real world
  • BigOnYa @ BigOnYa:
    Eyes - "yawn"
    +1
  • S @ salazarcosplay:
    you bleack in to goverment computer systems to get cyborg schematics so you can get a robot body constructed
  • Xdqwerty @ Xdqwerty:
    btw @BigOnYa the health bar doesnt decrease when i take damage (and yes i put the "at the beggining of the scene change value of greenflatbar: set to Protagonistcopmode.Health::Health())
  • S @ salazarcosplay:
    i the protagonist
  • S @ salazarcosplay:
    human, robot, cyborg
  • S @ salazarcosplay:
    human with cyborg enhancements
  • S @ salazarcosplay:
    or like terminatior
  • S @ salazarcosplay:
    with living tissue
  • BigOnYa @ BigOnYa:
    @Xdqwerty there is health behaviour you can add to your character, then to use a health bar is lil more complicated, google n watch a few tutorial video on it, be too hard to explain here.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, the character has the health behavior
  • BigOnYa @ BigOnYa:
    I know you have to create a health and health max variable. Then there is a calculation you use in code to subtract width size of the health bar. Google few vids.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, the "greenflatbar" is one of the preset health bars btw
  • BigOnYa @ BigOnYa:
    Yea you can use any bar/sprite. It will just change the width. Ok good luck and have fun. I'm off to go shoot some pool at the bar. Talk to you later.
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, why does the health behavior exist if you can just use a variable?
  • Xdqwerty @ Xdqwerty:
    and nope the number still doesnt change
  • Xdqwerty @ Xdqwerty:
    ok im gonna make my own asset
    Xdqwerty @ Xdqwerty: ok im gonna make my own asset