Exploring the Embedded Controller

Honestly, I think this is because the fan is targeting more than just the CPU temp. When charging, the power conversion circuitry can get fairly toasty as it wolfs down a full 60 watts. That may be the cause there… maybe.

I dug into using NBFC for battery control and gave up after stumbling into a big roadblock: it only takes one arbitrary value, “register”, as an 8-bit value (0-255) and have single byte (or word, as an option) outputs. The values for EC are 16-bit addresses with variable length values, so it doesn’t make much sense, didn’t know how to convert it. Maybe NBFC is made for an earlier generation of laptops, prior to this whole Windows 11/“always connected”/new-world-ROM sort of thing. I suspect an entirely new generation of EC goes along with it.

All I really want is user-land battery control, but since I power my laptop solely by battery bank (OmniCharge 20+) and solar juice, I’m almost always running on battery anyway, and the battery inherently stays in its happy zone (anywhere under 90%) just by usage patterns. Been an EV nerd for over 10 years now, so the car and the laptop batteries both ought to last basically forever. haha

My CPU rarely reaches 40° and I have been using Solar exclusively for 40 years.

Hardly a noise from the fan.

Ah okay, I never actually got to the point of looking at NBFC’s tools for making configs since I couldn’t even control the fan by writing to EC registers directly. I’m not super knowledgeable about either NBFC or firmware programming, but yeah from your analysis it does seem like NBFC might not be compatible with the Framework.

Maybe, although in my experience the fan speed seems unrelated to whether the laptop is actually charging or just maintaining the battery level while plugged in. Also, manually lowering the CPU boost aggressiveness by increasing the Speed Shift EPP makes it behave like it does on battery, i.e. the fan remains off even when streaming a high res video. This is the workaround I’m using right now, but it’s definitely not ideal because the fan sometimes still comes on (and stays on for a minute or two) if there’s a moment of high load.

Honestly, this particular thing is a very minor inconvenience, but the point is that it’s never bad to have more options because someone will have some way to make use of them. Having fan control – even through some custom utility if not through NBFC – would be in my opinion a very nice value add to the already extremely customizable nature of the Framework.

1 Like

Honestly this would be a cool lever to have at my command, whether plugged-in or not. Often, when I’m processing something, I’ll slide the Windows power slider (another thing missing in Windows 11, yay regression) over to performance mode, then slide back when it’s done. Or, conversely, when there’s a background task or I’m running low on battery, I’ll slide it to power-saving. Even that isn’t enough sometimes - in desperate times, with prior laptops, I’d edit the power profile to cap the CPU at 25% when something I’m running has a poorly designed tight loop and doesn’t really need the performance it’s demanding.

With the Framework’s new-world architecture, something totally unusual has occurred: there’s no longer any CPU power settings at all available to me. Something wants to run-away? Yeah, it’ll goose the CPU to 3GHz in power-save mode, and ain’t a damn thing I can do to stop it.

It’d be nice to have a tool with such settings available. Especially for a laptop as nerd-friendly as Framework :wink:

I’m not sure what you mean.

  • There are three selections under Windows 11 > Settings > Power and battery

  • You can create your own setup in Control panel > Power options > Create a power plan > Change settings > Change advanced power settings > Processor power management > etc.

Maybe you can set a few plans and make links to them?

No, you can not. That’s my point. (I’m very familiar with all the dials you can turn for power settings - you might think I’m not a noob needing to be pointed to this panel!) This Framework laptop - and my build in particular it seems - seems to have some differences from even other Framework laptops. For example, the default hibernate timing was “20 minutes”. Nobody else had seen that - on a clean install with the Framework driver bundle.

Zero controls. (that “Network connectivity” one is something I even had to hack-in with a registry tweak - and I don’t think it has any effect anyway)

Mine’s a newer one, bought from the store and shipped in a week, no batch number. Has the Tempo audio chip and came to me with BIOS 3.07. For what it’s worth. :man_shrugging:

How strange that you can not where I can ??

Maybe you are thinking of soemthing different that I ?

Never mind I’m sure you have an idea of what you want and are doing.

All the best. :slight_smile:

1 Like

If you’re not aware, the tool I’m using to adjust CPU behavior is Throttlestop. It can do quite a lot (more than the built-in Windows settings could), and even though it has a lot fewer usable controls on Tiger Lake than it had on previous platforms, you can at least adjust power limits and Speed Shift EPP which might be able to get the behavior you want. If you haven’t already, I would consider taking a look at it to see if it helps you at all.

2 Likes

fw-ec-keyboard-console

this is a custom hook, not built-in. sorry!

5 Likes

@DHowett, you seem to be accessing the EC console, which is pretty much exactly what I’m looking for right now.

Background: I’m investigating Laptop powers *on* after hibernate when unplugging/unpowering dock - #6 by Matthijs_Kooijman and want to verify whether the EC is responsible for powering on the machine. I found the ectool console command that allows reading the console, but the buffer is too small, so the startup overflows the buffer, so I can’t see what happened at poweron. If only I could access the console chan command to disable some of the debug channels, I should be able to see the log from actual startup moment.

I looked at the hardware UART, which has no connector soldered on and it is really tiny, if I would want to try that I should probably get the official connector that’s intended to go there (and even then I’m not sure I would manage to solder that tiny…).

I was wondering how you managed to access the console, and why it curiously seems to be running in a text editor, and then I found your code at Commits · DHowett/framework-ec · GitHub. Hah! You hijacked the keyboard driver in the EC to (when enabled with F12) insert keypresses into the console stream and emit output back into the keyboard, that’s superclever :slight_smile:

Doesn’t really help me, though, since if I am going to flash a custom EC firmware (which I’m a bit hesitant to do, lacking a way to unbrick things if I really mess up), I might as well hardcode disable some console output :slight_smile:

So, do you happen to know if there are any host commands (or other tricks) I could use to capture more output? I looked through the list of host commands, but nothing seemed appropriate…

Edit: I just found your ECTool.efi build and tried to see if that would maybe run early enough to capture the poweron output with its console command, but it’s still drowned in PORT80 log lines, unfortunately…

3 Likes

Thanks! :smiley:

Unfortunately, apart from changing the parameters and building it yourself I don’t see a way to quiet some of the more spammy logs. Nobody updates channel_mask outside of the chan command.

I was thinking that you may be able to use ectool's i2cread/i2cpassthru to get at the cyp5525’s BOOT_MODE_REASON. It would require some digging and the definitions for what those boot reasons are. However, I don’t think it’ll help with the problem at hand – the cyp5525 is probably coming up because it received power, and that doesn’t explain why the rest of the board is powering on.

\_(shrug)_/

2 Likes

That’s great, I’ll definitely try this out!

Is there also a way to change the power or current to charge the battery. If it can be set to a very low level, you can keep the battery at the same charge state without switching charging on and off.

You can set the battery to 60% in the BIOS as an example

Thank you for the reply! I’m not sure if what I said was clear.

I mean when I charge the laptop, the charger thats included will charge with 60 Watts power. The question is, can I modify the power of my charger so its charging slower to reduce stress on my battery (e.g. less heat and less rapid expansion).

If i limit the charge at 60% as you mentioned, it will charge with 60W until 60% charge is reached. But if I use 20W to charge it takes more time to charge, but my battery stays cooler.

It will only charge with what the battery requests, it will not charge at 60W. The 60W is just the maximum that the adapter can sustain.

The main battery ‘requests’ charge via what is called a PD protocol if there is no communication for example due to being connected to a Type A USB 3 port on a computer resort to 5V at 0.9A i.e. 4.5W.

Bascially the power supply only offers it doesn’t force the battery to charge.

The charging is done by negotiating a voltage to charge the battery as the battery sees fit, monitored by the Charging chip.

If the battery is very low 14.6 it may see if the charger can supply 20V at 3A for a short while.

When the battery reaches say 60% the voltage may be 15.4V and the request will drop the voltage maybe to 9V at 3A

Of course the battery will get warm if you both fully exploit the CPU/GPU and cause a huge drain and have the computer plugged in and the battery charging ~ then the 60W may be almost essential.

Sure using a charger that cannot provide as much power will do as you say.

You cannot modify the adapter unless it has it on the box, it cannot be done from the laptop.

My battery is set at 78% via the bios and neither the adapter or the battery get warm.

I also have a 12V car type charger that can negotiate the PD protocol or the QC3 for my Fairphone it can supply 85W.

You may be overly concerned about the battery.

Another issue is that if you use say a 30W charger that can negotiate the PD protocol it may push the adapter to the limit and if it not a classy adapter may damage it and more.

To ensure a slow charge you will require a non PD compliant charger so the computer only uses 5V at a max of 3A

1 Like

The short answer to this seems to be “no”, at least not without modifying the EC firmware. The closest thing you can do is to use a lower-power USB PD adapter, but this does introduce the possibility of draining the battery while plugged in if the computer consumes too much power. I can say from my own experience that a 30 watt adapter is fine if you’re using the machine mostly at idle or low CPU, and a 45 watt adapter is fine if you’re maxing out a single CPU core.

But more generally, taking advantage of the charge capacity (SOC percentage) limit and doing fewer charge-discharge cycles will have a much more profound impact on battery longevity than limiting the rate of charge.

Amoun, I have no idea what you mean by a “classy adapter”, but it is perfectly safe to run the Framework laptop from a 30 watt adapter that is USB PD compliant.

Without USB-PD negotiation, you may not even get 3 amps. It’s dependent on both the cables and the configuration of the charger. Using a lower-power PD-compliant adapter is a better solution.

1 Like

I had a BaseUs 65W PD QC charger and it got hot when loaded with the Framework and some plastic melted, needless to say it didn’t work well after that

Maybe PD works a lot different to QC charging. I was using a dumb 5V 2.4A supply and that seemed to draw max using my Fairphone. The odity being that although there was not QC communication occasionally it would say ‘Charging rapidly’ ?? just occassionaly :slight_smile:

1 Like

Thank you both for the further explanations.

If I understand batteries correctly a draining can only happen if the Voltage of your adapter is smaller than the Voltage of the battery.

I found the topic where the power adapter was introduced: The Power Adapter

It says its a PPS adapter, and if I understood correctly the output current can be programmed. Does this mean someone can program it in a way to be like a 30W adapter?

Ok I agree that maybe in the end this will extend the battery life not very much. I just thought that when users discuss the battery, it might be worth to also look at further details around.

While technically a correct statement for batteries in general, this is not relevant for the Framework. There is a DC-DC converter between the USB-C ports of the computer and the battery, so the input voltage doesn’t have any direct consequence on whether or not the battery is charging.

The input power system of the laptop negotiates with the power adapter to determine what amount of power (wattage) it is allowed to draw. It will then self-restrict the amount of power it draw to stay under that limit. If the laptop begins using more power than the negotiated limit, it will take the excess power from the battery so that it does not exceed its input power limit.

It’s my understanding that the Framework does not make use of the PPS mode. But regardless, it would not need PPS mode to self-enforce a lower power draw than the negotiated maximum. It would, however, require a modification to the EC firmware.

Indeed, QC works differently from PD. A compliant PD sink will never draw more than the negotiated maximum power, and in the absence of a PD negotiation, it will fall back to standard USB power signalling. This could limit you all the way down to 100 mA, or 1 A if you follow the USB 2.0 charging-only spec for shorting D+ and D- together.

1 Like

Just to update.

The battery will take what current it can get when it’s really flat and will warm a bit even with 20W…

I have just discharged my battery as much as I could and am charging it to 100% to reset the parameters for battery monitoring and to ‘stretch’ the battery.

In the first half an hour the charger got warm but the battery seemed fine.

It has taken 2½ hours to get to 95% and the last 1% took 10 min or more, there is no heat coming from the laptop.

As the battery charges the input reduces and so does the heat produced.

A 55W battery could charge to 50% in an hour if there is 60W available, maybe you can check using a 20W charger to see how much charge a completely discharged battery cab get in 1h :slight_smile: