Contribute
Register

Battery status not entirely working HP Omen X 17-AP020NR

Status
Not open for further replies.
Joined
Sep 9, 2018
Messages
32
Motherboard
HP Laptop MB CM238 chipset
CPU
i7-7820HK
Graphics
GTX 1080 8GB
I'm trying to create a patch for my battery status, but I've come across a few issues. At first I tried the patch for the G6 2221SS since it was very close to mine, and first, it appeared to be working, but the issue comes up when I try to charge, it doesn't. Because of this, I decided to try out my own patch, which after finishing it and applying it, I now get the battery percentage, but it won't charge, and won't report when it discharges as well. I'm not the greatest at this whole thing, so I thought I'd ask for help. I'll also include the patch that I made here:
Code:
#16 to 8 split
into device label EC0 code_regex BADC,\s+16, replace_matched begin
//BADC,   16,\n
                BAD0,   8,\n
                BAD1,   8,
end;
into device label EC0 code_regex BFCC,\s+16, replace_matched begin
//BFCC,   16,\n
                BFC0,   8,\n
                BFC1,   8,
end;
into device label EC0 code_regex MCUR,\s+16, replace_matched begin
//MCUR,   16,\n
                MCU0,   8,\n
                MCU1,   8,
end;
into device label EC0 code_regex MBRM,\s+16, replace_matched begin
//MBRM,   16,\n
                MBRX,   8,\n
                MBRY,   8,
end;
into device label EC0 code_regex MBCV,\s+16, replace_matched begin
//MBCV,   16,\n
                MBC0,   8,\n
                MBC1,   8,
end;
into device label EC0 code_regex SMW0,\s+16 replace_matched begin
//SMW0,   16\n
                SMWX,   8,\n
                SMWY,   8
end;


#8+8 method
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) \n    {\n        Return (Or (Arg0, ShiftLeft (Arg1, 8)))\n    }\n
end;

#8 to 16 read
into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.BADC, replaceall_matched begin /* ^^PCI0.LPCB.EC0.BADC, */ (B1B2 (^^PCI0.LPCB.EC0.BAD0, ^^PCI0.LPCB.EC0.BAD1), end;
into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.BFCC, replaceall_matched begin /* ^^PCI0.LPCB.EC0.BFCC */ (B1B2 (^^PCI0.LPCB.EC0.BFC0, ^^PCI0.LPCB.EC0.BFC1), end;
into method label GBIF code_regex \(\^\^PCI0\.LPCB\.EC0\.BFCC, replaceall_matched begin /* ^^PCI0.LPCB.EC0.BFCC */ (B1B2 (^^PCI0.LPCB.EC0.BFC0, ^^PCI0.LPCB.EC0.BFC1), end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MCUR, replaceall_matched begin /* ^^PCI0.LPCB.EC0.MCUR */ (B1B2 (^^PCI0.LPCB.EC0.MCU0, ^^PCI0.LPCB.EC0.MCU1), end;
into method label GBCO code_regex \(\^\^PCI0\.LPCB\.EC0\.MCUR, replaceall_matched begin /* ^^PCI0.LPCB.EC0.MCUR */ (B1B2 (^^PCI0.LPCB.EC0.MCU0, ^^PCI0.LPCB.EC0.MCU1), end;
into method label CLRI code_regex \(\^\^LPCB\.EC0\.MBRM, replaceall_matched begin /* ^^LPCB.EC0.MBRM */ (B1B2 (^^LPCB.EC0.MBRX, ^^LPCB.EC0.MBRY), end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBRM, replaceall_matched begin /* ^^PCI0.LPCB.EC0.MBRM */ (B1B2 (^^PCI0.LPCB.EC0.MBRX, ^^PCI0.LPCB.EC0.MBRY), end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBCV, replaceall_matched begin /* ^^PCI0.LPCB.EC0.MBCV */ (B1B2 (^^PCI0.LPCB.EC0.MBC0, ^^PCI0.LPCB.EC0.MBC1), end;
into method label SMRD code_regex \(SMW0, replaceall_matched begin /* SMW0 */ (B1B2 (SMWX, SMWY), end;

#8 to 16 write

into method label SMWR code_regex Store\s+\((.*),\s+SMW0\) replaceall_matched begin
// Store(%1, SMW0)\n
                        Store(%1, SMWX)\n
                        Store(ShiftRight(%1, 8), SMWY)
end;

#Buffer fields

into device label EC0 code_regex (SMD0,)\s+(256) replace_matched begin
//%1%2\n
                SMDP,   %2
end;
into device label EC0 code_regex (FLD0),\s+(64) replace_matched begin
//%1%2\n
                FLDA,   %2
end;
into device label EC0 code_regex (FLD1),\s+(128) replace_matched begin
//%1%2\n
                FLDB,   %2
end;
into device label EC0 code_regex (FLD2),\s+(192) replace_matched begin
//%1%2\n
                FLDC,   %2
end;
into device label EC0 code_regex (FLD3),\s+(256) replace_matched begin
//%1%2\n
                FLDD,   %2
end;

#EC buffer read-write

into device label EC0 insert
begin
Method (RE1B, 1, NotSerialized)\n
{\n
    OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
    Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
    Return(BYTE)\n
}\n
Method (RECB, 2, Serialized)\n
{\n
    ShiftRight(Add(Arg1,7), 3, Arg1)\n
    Name(TEMP, Buffer(Arg1) { })\n
    Add(Arg0, Arg1, Arg1)\n
    Store(0, Local0)\n
    While (LLess(Arg0, Arg1))\n
    {\n
        Store(RE1B(Arg0), Index(TEMP, Local0))\n
        Increment(Arg0)\n
        Increment(Local0)\n
    }\n
    Return(TEMP)\n
}\n
end;

into device label EC0 insert
begin
Method (WE1B, 2, NotSerialized)\n
{\n
    OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
    Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
    Store(Arg1, BYTE)\n
}\n
Method (WECB, 3, Serialized)\n
{\n
    ShiftRight(Add(Arg1,7), 3, Arg1)\n
    Name(TEMP, Buffer(Arg1) { })\n
    Store(Arg2, TEMP)\n
    Add(Arg0, Arg1, Arg1)\n
    Store(0, Local0)\n
    While (LLess(Arg0, Arg1))\n
    {\n
        WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n
        Increment(Arg0)\n
        Increment(Local0)\n
    }\n
}\n
end;

#EC buffer references

into method label SMRD code_regex \(FLD1, replaceall_matched begin (RECB (0x04, 128), end;
into method label SMRD code_regex \(FLD2, replaceall_matched begin (RECB (0x04, 192), end;
into method label SMRD code_regex \(FLD3, replaceall_matched begin (RECB (0x04, 256), end;

into method label SMWR code_regex Store\s+\((.*),\s+SMD0\) replaceall_matched begin WECB(0x37,256, %1) end;
 

Attachments

  • install_tools.zip
    1.4 KB · Views: 84
I'm trying to create a patch for my battery status, but I've come across a few issues. At first I tried the patch for the G6 2221SS since it was very close to mine, and first, it appeared to be working, but the issue comes up when I try to charge, it doesn't. Because of this, I decided to try out my own patch, which after finishing it and applying it, I now get the battery percentage, but it won't charge, and won't report when it discharges as well. I'm not the greatest at this whole thing, so I thought I'd ask for help. I'll also include the patch that I made here:
Code:
#16 to 8 split
into device label EC0 code_regex BADC,\s+16, replace_matched begin
//BADC,   16,\n
                BAD0,   8,\n
                BAD1,   8,
end;
into device label EC0 code_regex BFCC,\s+16, replace_matched begin
//BFCC,   16,\n
                BFC0,   8,\n
                BFC1,   8,
end;
into device label EC0 code_regex MCUR,\s+16, replace_matched begin
//MCUR,   16,\n
                MCU0,   8,\n
                MCU1,   8,
end;
into device label EC0 code_regex MBRM,\s+16, replace_matched begin
//MBRM,   16,\n
                MBRX,   8,\n
                MBRY,   8,
end;
into device label EC0 code_regex MBCV,\s+16, replace_matched begin
//MBCV,   16,\n
                MBC0,   8,\n
                MBC1,   8,
end;
into device label EC0 code_regex SMW0,\s+16 replace_matched begin
//SMW0,   16\n
                SMWX,   8,\n
                SMWY,   8
end;


#8+8 method
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) \n    {\n        Return (Or (Arg0, ShiftLeft (Arg1, 8)))\n    }\n
end;

#8 to 16 read
into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.BADC, replaceall_matched begin /* ^^PCI0.LPCB.EC0.BADC, */ (B1B2 (^^PCI0.LPCB.EC0.BAD0, ^^PCI0.LPCB.EC0.BAD1), end;
into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.BFCC, replaceall_matched begin /* ^^PCI0.LPCB.EC0.BFCC */ (B1B2 (^^PCI0.LPCB.EC0.BFC0, ^^PCI0.LPCB.EC0.BFC1), end;
into method label GBIF code_regex \(\^\^PCI0\.LPCB\.EC0\.BFCC, replaceall_matched begin /* ^^PCI0.LPCB.EC0.BFCC */ (B1B2 (^^PCI0.LPCB.EC0.BFC0, ^^PCI0.LPCB.EC0.BFC1), end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MCUR, replaceall_matched begin /* ^^PCI0.LPCB.EC0.MCUR */ (B1B2 (^^PCI0.LPCB.EC0.MCU0, ^^PCI0.LPCB.EC0.MCU1), end;
into method label GBCO code_regex \(\^\^PCI0\.LPCB\.EC0\.MCUR, replaceall_matched begin /* ^^PCI0.LPCB.EC0.MCUR */ (B1B2 (^^PCI0.LPCB.EC0.MCU0, ^^PCI0.LPCB.EC0.MCU1), end;
into method label CLRI code_regex \(\^\^LPCB\.EC0\.MBRM, replaceall_matched begin /* ^^LPCB.EC0.MBRM */ (B1B2 (^^LPCB.EC0.MBRX, ^^LPCB.EC0.MBRY), end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBRM, replaceall_matched begin /* ^^PCI0.LPCB.EC0.MBRM */ (B1B2 (^^PCI0.LPCB.EC0.MBRX, ^^PCI0.LPCB.EC0.MBRY), end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBCV, replaceall_matched begin /* ^^PCI0.LPCB.EC0.MBCV */ (B1B2 (^^PCI0.LPCB.EC0.MBC0, ^^PCI0.LPCB.EC0.MBC1), end;
into method label SMRD code_regex \(SMW0, replaceall_matched begin /* SMW0 */ (B1B2 (SMWX, SMWY), end;

#8 to 16 write

into method label SMWR code_regex Store\s+\((.*),\s+SMW0\) replaceall_matched begin
// Store(%1, SMW0)\n
                        Store(%1, SMWX)\n
                        Store(ShiftRight(%1, 8), SMWY)
end;

#Buffer fields

into device label EC0 code_regex (SMD0,)\s+(256) replace_matched begin
//%1%2\n
                SMDP,   %2
end;
into device label EC0 code_regex (FLD0),\s+(64) replace_matched begin
//%1%2\n
                FLDA,   %2
end;
into device label EC0 code_regex (FLD1),\s+(128) replace_matched begin
//%1%2\n
                FLDB,   %2
end;
into device label EC0 code_regex (FLD2),\s+(192) replace_matched begin
//%1%2\n
                FLDC,   %2
end;
into device label EC0 code_regex (FLD3),\s+(256) replace_matched begin
//%1%2\n
                FLDD,   %2
end;

#EC buffer read-write

into device label EC0 insert
begin
Method (RE1B, 1, NotSerialized)\n
{\n
    OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
    Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
    Return(BYTE)\n
}\n
Method (RECB, 2, Serialized)\n
{\n
    ShiftRight(Add(Arg1,7), 3, Arg1)\n
    Name(TEMP, Buffer(Arg1) { })\n
    Add(Arg0, Arg1, Arg1)\n
    Store(0, Local0)\n
    While (LLess(Arg0, Arg1))\n
    {\n
        Store(RE1B(Arg0), Index(TEMP, Local0))\n
        Increment(Arg0)\n
        Increment(Local0)\n
    }\n
    Return(TEMP)\n
}\n
end;

into device label EC0 insert
begin
Method (WE1B, 2, NotSerialized)\n
{\n
    OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
    Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
    Store(Arg1, BYTE)\n
}\n
Method (WECB, 3, Serialized)\n
{\n
    ShiftRight(Add(Arg1,7), 3, Arg1)\n
    Name(TEMP, Buffer(Arg1) { })\n
    Store(Arg2, TEMP)\n
    Add(Arg0, Arg1, Arg1)\n
    Store(0, Local0)\n
    While (LLess(Arg0, Arg1))\n
    {\n
        WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n
        Increment(Arg0)\n
        Increment(Local0)\n
    }\n
}\n
end;

#EC buffer references

into method label SMRD code_regex \(FLD1, replaceall_matched begin (RECB (0x04, 128), end;
into method label SMRD code_regex \(FLD2, replaceall_matched begin (RECB (0x04, 192), end;
into method label SMRD code_regex \(FLD3, replaceall_matched begin (RECB (0x04, 256), end;

into method label SMWR code_regex Store\s+\((.*),\s+SMD0\) replaceall_matched begin WECB(0x37,256, %1) end;
No "Problem Reporting" files attached.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
Use the gen_debug.sh tool mentioned in the FAQ, that way it is less likely you'll omit something.
 
No "Problem Reporting" files attached.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
Use the gen_debug.sh tool mentioned in the FAQ, that way it is less likely you'll omit something.
Oh, I drunkenly attached the tool to generate them. Oops. Anyways here they are
 

Attachments

  • debug_14830.zip
    4.1 MB · Views: 101
Oh, I drunkenly attached the tool to generate them. Oops. Anyways here they are

Your kextcache shows obvious mistakes in installing kexts.
See FAQ:
 
Your kextcache shows obvious mistakes in installing kexts.
See FAQ:
Am I installing them to the wrong place? I use Kextbeast.
 
Read the FAQ.
sigh I reinstalled every kext that way I guess, omitting two I didn't need. Anyway, I got the battery status working, Though in the future I'd like to change it to a hot patch. I had to use this:
Code:
into method label INIT parent_label ACEL replace_content begin // code removed\n end;
This was that commented out part in the 2221SS patch. Though while I'm here, can I ask why my system will frequently slow down? By slow I mean choppy screen and delayed inputs, but the CPU speeds and temps aren't affected.
 

Attachments

  • debug_19299.zip
    3.3 MB · Views: 104
Though while I'm here, can I ask why my system will frequently slow down? By slow I mean choppy screen and delayed inputs, but the CPU speeds and temps aren't affected.

Clearly off-topic (read the thread title).
 
Status
Not open for further replies.
Back
Top