FrameworkComputer / framework-system

Rust libraries and tools to interact with the Framework Computer systems
BSD 3-Clause "New" or "Revised" License
106 stars 6 forks source link

Charge Limit not preserved after reboot #25

Open stefanhoelzl opened 5 months ago

stefanhoelzl commented 5 months ago

When using framework_tool to set a charge limit it is not preserved after reboot. After rebooting the charge limit is always 100%.

I am running it on a Framework 13 AMD and Fedora 39 Silverblue with these kernel patches

DeflateAwning commented 3 months ago

As a temporary workaround until an option to save the configuration is added, I added the following to my /etc/rc.local file:

cat /etc/rc.local
#!/bin/sh -e

# By default this script does nothing.

# Set the Framework charge limit to 90%
/usr/local/bin/framework_tool --charge-limit 90

exit 0

This works on Linux Mint, at least.

JohnAZoidberg commented 2 months ago

I debugged this and the reason is that the BIOS overwrites your setting on every boot. You can go into the BIOS settings to make it persistent.

We're investigating how to best fix this.

xamindar commented 2 months ago

It needs to write its update to the bios value. Any other route is just a workaround to this bug.

leiserfg commented 1 month ago

I feel it's a https://xkcd.com/1172/ case, cause I like that it sets the value only temporarily, so I can set the limit to 80% in the BIOS and upgrade it to 100% only when I'm in a long travel. So if changed, please make it so writing to BIOS is only optional.