Contribute
Register

[Guide] How to patch DSDT for working battery status

Joined
Dec 18, 2019
Messages
28
Motherboard
Acer Aspire A715-74G-78KF
CPU
i7-9750H
Graphics
UHD 630
Mac
MacBook Pro
According to your ioreg, the _STA method of device BAT1 is not returning 0x1F

Patch your DSDT BAT1._STA method as below
Code:
Method (_STA, 0, NotSerialized)  // _STA: Status
{
    Return (0x1F)
}
Read this guide for patching

You also have ACPI errors: your SSDT-I2C is referring to TPD1 you don't have. (see kernel_log)
Code:
2019-12-29 13:12:28.719644+0200 0x71       Default     0x0                  0      0    kernel: (AppleACPIPlatform) ACPI Error:
2019-12-29 13:12:28.719904+0200 0x71       Default     0x0                  0      0    kernel: (AppleACPIPlatform) [_SB_.PCI0.I2C1.TPD1]
Change I2C1.TPD1 to I2C0.TPD0
Also EC0 should be patched to EC (available in Clover Configurator ACPI section, "List Of Patches" popup)

Hibernate still active. It must be disabled (Hackintool is the fast way to do it...)

You need USB injection as per below guide...
Hi FreeJack, thank you for such quick response. Wow, you given us more than just anticipated. I have implemented all the above except the usb because it is something that I still need to do in my guide here : Guide Aspire A715-74G-78KF.

Your fix related to battery status still has some challenges. I have made a screen recording. See attached.
- Selecting the "Show batter status in menu bar" momentarily displays the status but then it disappears.
- and the "Current battery charge" is 0 although it should be almost at 100% as it is plugged in and the blue light indicator is on.
 

Attachments

Last edited:
Joined
Dec 18, 2019
Messages
28
Motherboard
Acer Aspire A715-74G-78KF
CPU
i7-9750H
Graphics
UHD 630
Mac
MacBook Pro
Guys,

Please can someone help with battery status: I'm using ACPIBatteryManager.kext.

Problem:
Battery indicator not showing. Only momentarily but then disappears.

I think I narrowed it down to the _BST methods at line 49279 in \_SB.PCI0.LPCB:

Code:
Method (_BST, 0, NotSerialized)  // _BST: Battery Status
            {
                Name (PBST, Package (0x04)
                {
                    Zero,
                    0xFFFFFFFF,
                    0xFFFFFFFF,
                    0x1770
                })
                If (ECOK ())
                {
                    Store (^^EC0.BST0, Index (PBST, Zero))
                    If (ShiftRight (^^EC0.BAC0, 0x0F))
                    {
                        Add (And (Not (^^EC0.BAC0), 0xFFFF), One, Local4)
                    }
                    Else
                    {
                        Store (^^EC0.BAC0, Local4)
                    }

                    If (LEqual (^^EC0.BAM0, Zero))
                    {
                        Divide (Multiply (Local4, ^^EC0.BPV0), 0x03E8, , Local4)
                    }

                    Store (Local4, Index (PBST, One))
                    Store (Multiply (^^EC0.BRC0, BASC), Index (PBST, 0x02))
                    Store (^^EC0.BPV0, Index (PBST, 0x03))
                    If (LNotEqual (^^EC0.BDC0, BMDL))
                    {
                        Notify (BAT1, 0x81)
                    }
                }

Where the If(ECOK ()) method should be invoke but never does.

My DSDT method for ECOK () can be found at line 48197 here:

Code:
Scope (_SB.PCI0.LPCB)
    {
     Method (ECOK, 0, NotSerialized)
        {
            If (LEqual (^EC0.OKEC, One))
            {
                Return (One)
            }
            Else
            {
                Return (Zero)
            }
        }
.....
.....
NOTE:
1. ^EC0.OKEC is never set in my DSDT.
2. I have tried to temporarily set method ECOK () to always return (One) but that does not work either.
 

Attachments

Last edited:
Joined
Dec 18, 2019
Messages
28
Motherboard
Acer Aspire A715-74G-78KF
CPU
i7-9750H
Graphics
UHD 630
Mac
MacBook Pro
@FreeJHack or anyone with some knowledge,

Note sure if this post belong under this topic ?

I have tried FakeSMC with ACPIBatteryManager without any success. See posts #5,112 and #5,114.

I have switch over to VirtualSMC and SMCBatteryManager.kext. and thus drop ACPIBatteryManager and FakeSMC.

The kernel log shows "AppleSmartBatteryManager) Failed to read key rc:0x87".

NOTE:
1. With FakeSMC and ACPIBatterManager AppleSmartBattery does NOT even feature in the kernel log files, suggesting it is not loading ?
2. While VirtualSMC and SMCBatteryManager seems to try and load AppleSmartBatterManager.

Therefore my battery status is not showing under menubar and when activated it disappears quickly.
SysInfo also show battery not loaded.

Battery.png


Can someone please provide insight or guidance ? I'm I missing a patch of some sorts ?
Much appreciated.
 

Attachments

Last edited:
Joined
Nov 10, 2015
Messages
114
Motherboard
Clevo 970EF Defiance VI - OpenCore
CPU
i7-8750H/HM370
Graphics
UHD630, RTX 2070, 1920x1080
Mac
iMac, MacBook Pro, Mac mini
Classic Mac
128K, iMac, PowerBook
Mobile Phone
iOS
@fireCat
You must disable _STA to XSTA patch in clover config.plist.
The _STA method is mandatory for battery status and 0x1F must be returned.
In addition, SMCBatteryManager.kext is missing in clover kext/other folder.

You're still having ACPI errors (look at kernel.log): even SSDT-9-ACRPRDCT should be patched changing GFX0 to IGPU
 
Last edited:

Feartech

Moderator
Joined
Aug 3, 2013
Messages
17,782
Motherboard
Asus N752VX-OpenCore
CPU
i7-6700HQ / HM170
Graphics
HD 530 1920 x 1080
Mac
iMac
Mobile Phone
iOS
@fireCat
You must disable _STA to XSTA patch in clover config.plist.
The _STA method is mandatory for battery status and 0x1F must be returned.

You're still having ACPI errors (look at kernel.log): even SSDT-9-ACRPRDCT should be patched changing GFX0 to IGPU
it is also best to just perform renames in config.plist rather than renames in dsdt and ssdt's :)
 
Joined
Dec 18, 2019
Messages
28
Motherboard
Acer Aspire A715-74G-78KF
CPU
i7-9750H
Graphics
UHD 630
Mac
MacBook Pro
@freejack , Tx for your reply. Happy new year !

It is a bit confusing to me, kindly clarify

1. are you saying the patch _STA to XSTA must be disabled like this ?

Screenshot 2020-01-03 at 08.27.06.png


2. AND THAT the method must return 0x1F like this: hence removing all the code from If (ECOK ())

Code:
Device (BAT1)
        {
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
               Return (0x1F)
              /*If (ECOK ())
                {
                    If (^^EC0.BOL0)
                    {
                        Return (0x1F)
                    }
                    Else
                    {
                        Return (0x0F)
                    }
                }
                Else
                {
                    Return (0x1F)
                }*/             
            }
        }

3. Likewise the patch for changing GFX0 to IGPU should be: ?
Screenshot 2020-01-03 at 08.43.23.png


I can't help but to note that in clover boot loader under DSDT patch ACPI the reciprocal seems to be the case. See picture below. If you use clover configurator and set disabled flag to true it would not be selected at runtime when you load the boot loader.

So I'm not sure which to use ?

IMG_6338.jpeg
 
Last edited:
Joined
Dec 18, 2019
Messages
28
Motherboard
Acer Aspire A715-74G-78KF
CPU
i7-9750H
Graphics
UHD 630
Mac
MacBook Pro
it is also best to just perform renames in config.plist rather than renames in dsdt and ssdt's :)
@Feartech & @FreeJHack,

Thx for your help. It did point me into the right direction.

Patching STA to XSTA to be disabled like above was only half of the solution. In the end I still needed to apply:
ACPI Patch like Pilgrim suggested here: ACPI Patch on post #19.

Screenshot 2020-01-03 at 11.25.16.png


If I don't use ACPI Patch I get this ACPIBatteryManager warning (hang at boot, slow and non-responsive) :

IMG_6335.jpeg


Now, finally the battery status is showing up.

Appreciate your efforts !
 

Attachments

Last edited:
Top