Fix for Linux Battery issue

Discussion in 'Switch - Tutorials' started by Crystalseed, Jun 24, 2018.

  1. Crystalseed
    OP

    Crystalseed Newbie

    Newcomer
    1
    Jun 24, 2018
    United States
    Here's a quick and easy fix for the turning off at 40% battery issue that people are seeing after running Linux. This is effectively the same fix as unplugging the battery, but does so without having to take apart the Switch.

    Step 1: Download attached fusee-linux-battery-fix.rar
    Step 2: Extract and load the binary with your favorite RCM Smash tool (I'm using TegraRcmSmash).
    Step 3: You should see the typical fusee screen, at this point unplug the USB cable. The screen should go off.
    Step 4 (optional?): Hold the power button for 10 seconds. Your switch won't turn on at this point, that's desired.
    Step 5: Plug in a USB cable. Switch will turn on, and you're done.

    This worked to fix my Switch, let me know if it works for you.

    Edit:

    Source is here:

    github/crystalseedgba/BatteryFix/blob/master/fusee/src/main.c (Sorry it's not letting me post hyperlinks)

    This doesn't fix the Linux bug, this is really just a crude workaround. At first I suspected that Linux is somehow mangling the battery gauge but this doesn't seem to be the case. The battery gauge reports around 40% and decent battery voltage when my Switch would turn off. I think Linux is misconfiguring some undervoltage lockout somewhere, but I don't know where.

    Thanks to jjbredesen for his "How to make a custom Fusee payloads" tutorial.
     

    Attached Files:

    Last edited by Crystalseed, Jun 24, 2018
    MannyS, ahezard, NoNAND and 45 others like this.
  2. Notex

    Notex Advanced Member

    Newcomer
    3
    Mar 21, 2017
    Australia
    What exactly does this do to fix the battery? Did you code this or did you find it somewhere? I'm kinda anxious about just running a random binary on my switch.
     
    machine69_420 likes this.
  3. x0x0

    x0x0 GBAtemp Regular

    Member
    5
    Nov 15, 2017
    Poland
    Inside the code
    Lol 1 post guy, dont use it...
    EDIT: THIS IS WORKING THANK YOU OP
     
    Last edited by x0x0, Jun 24, 2018
    Ty_, lordelan, Extrasklep and 2 others like this.
  4. Soluble

    Soluble GBAtemp Advanced Fan

    Member
    5
    Mar 12, 2017
    Yeah I don't have the issue, but this is a good time to remind everyone NOT to use random payloads we know nothing about.
     
  5. Benoit934

    Benoit934 GBAtemp Regular

    Member
    2
    Oct 31, 2016
    France
    Source code ?
    I mean can you please give us the source code ?
     
    Dionicio3 and Notex like this.
  6. LeRepex

    LeRepex Member

    Newcomer
    1
    Nov 8, 2016
    Germany
    just tried it out for me it seems to work. having my switch playing some games now to waste some battery and see if it turns off
     
  7. Notex

    Notex Advanced Member

    Newcomer
    3
    Mar 21, 2017
    Australia
    You are brave. I guess you are our guinea pig :P
     
    NoNAND likes this.
  8. Clydefrosch

    Clydefrosch GBAtemp Psycho!

    Member
    10
    Jan 2, 2009
    Germany
    or he's another sock puppet trying to sucker you into bricking your switches
     
  9. LeRepex

    LeRepex Member

    Newcomer
    1
    Nov 8, 2016
    Germany
    it was more just "yes finaly i can fix my switch than thinking about the risks :D"

    also i can say my switch is running super mario odysee right now with 35% without turning off so it seems to have fixed it before the limit was about 40%

    — Posts automatically merged - Please don't double post! —

    If you want i can post pics
     
  10. Notex

    Notex Advanced Member

    Newcomer
    3
    Mar 21, 2017
    Australia
    That's great news. I am going to wait until a few more people try it first though before I try. It just seems very sketchy that someone new to the forum has posted this fix.
     
  11. LeRepex

    LeRepex Member

    Newcomer
    1
    Nov 8, 2016
    Germany
    Thought the same at first but only the chance to fix my switch without taking it apart was enough for me to try it :D
     
    Type_O_Dev likes this.
  12. Benoit934

    Benoit934 GBAtemp Regular

    Member
    2
    Oct 31, 2016
    France
    Even a video capture wouldn't be enough because you can run a dummy payload letting the think it's working but actually sending a bad payload.
    I don't know why someone might do this but for avoiding the paranoia around here the best way is to have the source code that we compile ourselves after checking after what it's doing.
    They fear TX too so ...
     
  13. LeRepex

    LeRepex Member

    Newcomer
    1
    Nov 8, 2016
    Germany
    Yes thats actually a good point but still if you want i can post pics maybe also a video with download process

    EDIT: 30% and still running fine
     
    Last edited by LeRepex, Jun 24, 2018
  14. Benoit934

    Benoit934 GBAtemp Regular

    Member
    2
    Oct 31, 2016
    France
    @LeRepex I beleive you and I'll not blame the newcomer for being a newcomer but it would be great if he share the source code, it's a fix there is no reasons to not share it
     
  15. rajkosto

    rajkosto GBAtemp Advanced Fan

    Member
    11
    Apr 6, 2017
    Source code posting along with the binaries is actually REQUIRED since this is based on the fusee payload code base (GPLv2 licence)... don't run this until someone else has compiled it and verified the binaries are similar.
     
  16. LeRepex

    LeRepex Member

    Newcomer
    1
    Nov 8, 2016
    Germany
    Yes thats actually true :D

    EDIT: 20% and still running Mario Odyssey just fine
    EDIT 2: 10% Still running i will now charge my switch up again. who ever made this fix i love you
     
    Last edited by LeRepex, Jun 24, 2018
    Type_O_Dev likes this.
  17. xXxSwagnemitexXx

    xXxSwagnemitexXx meme machine

    Member
    5
    Dec 7, 2016
    United Kingdom
    New Donk City
    doubtful, ill probably try it though
     
  18. rajkosto

    rajkosto GBAtemp Advanced Fan

    Member
    11
    Apr 6, 2017
    Code:
      init_i2c_controller(0);
      i2c_read_register((int)v2, 1u, 0, 0x6B, 0xA);
      if ( v2[0] != 0x2F )
      {
        printk("ERROR: charger part number mismatch got: 0x%02x want: 0x%02x\n\n   ", v2[0], 0x2F);
        while ( 1 )
          ;
      }
      i2c_read_register((int)&v2[1], 1u, 0, 0x6B, 5);
      v2[1] &= 0xCFu;
      i2c_write_register(0, 0x6B, 5, &v2[1], 1);
      i2c_read_register((int)&v2[2], 1u, 0, 0x6B, 7);
      v2[2] |= 0x20u;
      i2c_write_register(0, 107, 7, &v2[2], 1);
      printk("\n\nBATFET is now disabled, disconnect the USB cable.\n\n");
    
    reverse engineered code, so doesnt seem too malicious.
     
    gnmmarechal, otto888, daxtsu and 9 others like this.
  19. x0x0

    x0x0 GBAtemp Regular

    Member
    5
    Nov 15, 2017
    Poland
    Inside the code
    GL post results.

    I will be really surprised if this is a real fix
     
  20. dark_samus3

    dark_samus3 GBAtemp Addict

    Member
    9
    May 30, 2015
    United States
    EDIT: looks like it was already posted above :|
     
Loading...