# \[RESOLVED\] Change battery max charge from OS?

**URL:** <https://community.frame.work/t/resolved-change-battery-max-charge-from-os/48899>\
**Category:** Linux\
**Tags:** debian\
**Created:** [April 14, 2024, 2:25am UTC](https://community.frame.work/t/resolved-change-battery-max-charge-from-os/48899 "2024-04-14T02:25:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apeiron\_Tsuka](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@Apeiron\_Tsuka](https://community.frame.work/u/Apeiron_Tsuka)\
**Post date:** [April 14, 2024, 2:25am UTC](https://community.frame.work/t/resolved-change-battery-max-charge-from-os/48899/1 "2024-04-14T02:25:13Z")

</div>

The UEFI BIOS has a setting for a maximum charge level for if the laptop is primarily plugged in. Is there a way to change this setting from the OS? It would be useful to, say, set the limit to 60% but be able to (using ectool as an example) `ectool batterylimit 100` to charge to full in preparation for an extended time on battery and then setting it back later, but I haven’t been able to find any mechanism for doing this (if there is one).

---

<div class="post-metadata">

**Author:** ![Ulmondil](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/ulmondil/32/24591_2.png) [@Ulmondil](https://community.frame.work/u/Ulmondil)\
**Post date:** [April 14, 2024, 2:34pm UTC](https://community.frame.work/t/resolved-change-battery-max-charge-from-os/48899/2 "2024-04-14T14:34:32Z")

</div>

There is. At least for the fw13 but I suppose fw16 works the same as fw13 amd.

Take a look at:

- [GitHub - FrameworkComputer/framework-system: Rust libraries and tools to interact with the Framework Computer systems](https://github.com/FrameworkComputer/framework-system)
- discussion about ec: [Exploring the Embedded Controller - #122 by DHowett](http://community.frame.work/t/exploring-the-embedded-controller/12846/122)
- daemon + gnome extension(develop by @stefanho): [GitHub - stefanhoelzl/frameworkd](https://github.com/stefanhoelzl/frameworkd/)
- same topic/question but regarding fw13: [Can the battery charge limit be set from Linux?](http://community.frame.work/t/can-the-battery-charge-limit-be-set-from-linux/28722)

On Intel FW everything works fine, but today (as of linux 6.9) this tools are not working out of the box for AMD:

- the `cros-ec` driver won’t work on amd systems (I confirm with regards to amd FW13 but iirc for FW16 is the same) until [Re: [PATCH v3 0/4] platform/chrome: cros\_ec\_lpc: add support for AMD Framework Laptops - patchwork-bot+chrome-platform](https://lore.kernel.org/all/171256862794.1734.3940454654342170565.git-patchwork-notify@kernel.org/) is merged (you can build your kernel)
- the `portio` driver won’t work when kernel lockdown is enforced (always when SecureBoot is active unless you have some custom module or patch the kernel), see [Framework 13 AMD Support on Linux · Issue #20 · FrameworkComputer/framework-system · GitHub](https://github.com/FrameworkComputer/framework-system/issues/20)

---

<div class="post-metadata">

**Author:** ![Apeiron\_Tsuka](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@Apeiron\_Tsuka](https://community.frame.work/u/Apeiron_Tsuka)\
**Post date:** [April 14, 2024, 3:39pm UTC](https://community.frame.work/t/resolved-change-battery-max-charge-from-os/48899/3 "2024-04-14T15:39:23Z")

</div>

Seems my problem was that it isn’t listed in `ectool help` so I didn’t know the fwchargelimit existed when I went searching for a way to do this yesterday.

Thanks for the help Ulmondil. It works out-of-the-box for me as my version of ectool has DHowett’s patches [1] for working around missing Framework support in upstream cros\_ec[\_lpc]. Because of this, the need of portio is solved.

[1] There’s a ectool-only repo on [GitLab](https://gitlab.howett.net/DHowett/ectool) by DHowett for anyone who stumbles on this thread later.

---

<div class="post-metadata">

**Author:** ![Matthew\_Shapiro](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@Matthew\_Shapiro](https://community.frame.work/u/Matthew_Shapiro)\
**Post date:** [April 14, 2024, 5:50pm UTC](https://community.frame.work/t/resolved-change-battery-max-charge-from-os/48899/4 "2024-04-14T17:50:24Z")

</div>

Thanks to Aperion! And the Framework commands are listed in [include/framework\_oem\_ec\_commands.h · main · Dustin L. Howett / ectool · GitLab](https://gitlab.howett.net/DHowett/ectool/-/blob/main/include/framework_oem_ec_commands.h).
