Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 78 additions & 20 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,18 +481,73 @@ Board IDs
Example on one system, note that different systems have different thermal
sensors and number of fans, so your output may look different:

The sensor names are reported by the EC firmware:

```
> sudo framework_tool --thermal
F75303_Local: 43 C
F75303_CPU: 44 C
F75303_DDR: 39 C
APU: 62 C
API Fan: 0 RPM
local_f75397@4c: 36 C
cpu_f75303@4d: 37 C
battery_temp@b: 32 C
ddr_f75303@4d: 35 C
peci-temp: 42 C
APU Fan: 0 RPM
AP Throttle Status
Soft: false
Hard: false
```

## Check thermal thresholds

Show the temperatures at which the EC takes action, per sensor:

- `warn`: Notify the OS with a thermal host event
- `high`: Throttle the CPU (PROCHOT)
- `halt`: Shut down the system
- `fan_off`/`fan_max`: Fan curve, fan is off below `fan_off` and at 100%
above `fan_max`. Note that not all sensors are used for fan control.

A `-` means the threshold is disabled:

```
> sudo framework_tool --thermalget
sensor warn high halt fan_off fan_max name
0 - 88 98 40 75 local_f75397@4c
1 - 88 98 40 78 cpu_f75303@4d
2 - 50 60 40 50 battery_temp@b
3 - 87 97 40 50 ddr_f75303@4d
4 - 120 127 103 105 peci-temp
(all temps in degrees Celsius)
```

## Set thermal thresholds

Adjust the thresholds shown by `--thermalget`. The arguments are
`<sensor> <warn> [high [halt [fan_off [fan_max]]]]` in degrees Celsius,
in the same order as the `--thermalget` columns. Use `-1` to keep a
threshold and `0` to disable it. The tool prints the resulting
configuration:

```
# Lower the battery (sensor 2) high/halt thresholds to 45/55 degrees
> sudo framework_tool --thermalset 2 -1 45 55
sensor warn high halt fan_off fan_max name
0 - 88 98 40 75 local_f75397@4c
1 - 88 98 40 78 cpu_f75303@4d
2 - 45 55 40 50 battery_temp@b
3 - 87 97 40 50 ddr_f75303@4d
4 - 120 127 103 105 peci-temp
(all temps in degrees Celsius)

# Make the CPU sensor (sensor 1) spin the fan up at 45 and reach 100% at 70 degrees
> sudo framework_tool --thermalset 1 -1 -1 -1 45 70
```

**Note:** There is no command to restore the default thresholds. They are
compiled into the EC firmware and only re-applied when the EC itself
reboots (e.g. after the system was powered off and disconnected from
power for a while). Check the current values with `--thermalget` before
changing them, so you can restore them manually.

## Check sensors

### Ambient Light (Laptop 13, Laptop 16)
Expand All @@ -519,30 +574,33 @@ Accelerometers:
> sudo framework_tool --fansetduty 100
> sudo framework_tool --fansetduty 0 100
> sudo framework_tool --thermal
F75303_Local: 40 C
F75303_CPU: 41 C
F75303_DDR: 37 C
APU: 42 C
APU Fan: 7281 RPM
local_f75397@4c: 40 C
cpu_f75303@4d: 41 C
battery_temp@b: 32 C
ddr_f75303@4d: 37 C
peci-temp: 42 C
APU Fan: 7281 RPM

# Set a target RPM (all or just fan ID=0)
> sudo framework_tool --fansetrpm 3141
> sudo framework_tool --fansetrpm 0 3141
> sudo framework_tool --thermal
F75303_Local: 41 C
F75303_CPU: 42 C
F75303_DDR: 37 C
APU: 44 C
APU Fan: 3171 RPM
local_f75397@4c: 41 C
cpu_f75303@4d: 42 C
battery_temp@b: 32 C
ddr_f75303@4d: 37 C
peci-temp: 44 C
APU Fan: 3171 RPM

# And back to normal
> sudo framework_tool --autofanctrl
> sudo framework_tool --thermal
F75303_Local: 40 C
F75303_CPU: 40 C
F75303_DDR: 38 C
APU: 42 C
APU Fan: 0 RPM
local_f75397@4c: 40 C
cpu_f75303@4d: 40 C
battery_temp@b: 32 C
ddr_f75303@4d: 38 C
peci-temp: 42 C
APU Fan: 0 RPM

# Or just for a specific fan (e.g. on Framework Desktop)
> sudo framework_tool --autofanctrl 0
Expand Down
46 changes: 46 additions & 0 deletions EXAMPLES_ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,35 @@ Tablet mode:
> framework_tool --tablet-mode auto
```

## Check EC switch positions

Show the current positions of the switches the EC monitors
(e.g. to debug lid or power button issues):

```
> framework_tool --switches
Current switches: 0x01
Lid switch: OPEN
Power button: UP
Write protect: DISABLED
Dedicated recovery: DISABLED
```

## Check port 80 POST code history

The EC records all POST codes the BIOS writes to port 80 during boot.
Useful to debug where the BIOS got stuck if the system does not boot:

```
> framework_tool --port80read
Port 80 writes
25 25 73 93 74 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75
75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75
75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 76 77 79 9c
7a fe 7b f8 00 00 00 00 <--new
done.
```

## Flashing EC firmware

**IMPORTANT** Flashing EC firmware yourself is not recommended. It may render
Expand Down Expand Up @@ -424,3 +453,20 @@ Comparison Result: 1
Shell> echo %lasterror%
0x1
```

## EC Panic Info

See what happened when the EC last crashed:

```
> framework_tool --panicinfo
Saved panic data:
Flags: 0x0e (OLD_CONSOLE | OLD_HOSTCMD | OLD_HOSTEVENT)
=== PROCESS EXCEPTION: 09 ====== xPSR: ffffffff ===
r0 : r1 : r2 : r3 :
r4 :dead6664 r5 :00000000 r6 :00000000 r7 :00000000
r8 :00000000 r9 :00000000 r10:00000000 r11:00000000
r12: sp :00000000 lr : pc :

cfsr = 0, shcsr = 0, hfsr = 0, dfsr = 0
```
8 changes: 8 additions & 0 deletions framework_lib/src/chromium_ec/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ use super::{CrosEc, CrosEcDriver, EcError, EcResult};
#[derive(Debug, FromPrimitive)]
#[repr(u16)]
pub enum EcCommands {
Hello = 0x01,
GetVersion = 0x02,
GetBuildInfo = 0x04,
/// Command to read data from EC memory map
ReadMemMap = 0x07,
GetCmdVersions = 0x08,
GetProtocolInfo = 0x0B,
FlashInfo = 0x10,
/// Write section of EC flash
FlashRead = 0x11,
Expand All @@ -37,7 +39,11 @@ pub enum EcCommands {
MotionSense = 0x002B,
PwmGetDuty = 0x0026,
SetTabletMode = 0x0031,
Port80Read = 0x0048,
ThermalSetThreshold = 0x0050,
ThermalGetThreshold = 0x0051,
AutoFanCtrl = 0x0052,
TempSensorGetInfo = 0x0070,
GpioSet = 0x0092,
GpioGet = 0x0093,
I2cPassthrough = 0x009e,
Expand All @@ -53,6 +59,8 @@ pub enum EcCommands {
Reboot = 0x00D1,
/// Control EC boot
RebootEc = 0x00D2,
/// Get information about the last EC panic
GetPanicInfo = 0x00D3,
/// Get information about PD controller power
UsbPdPowerInfo = 0x0103,
GetUptimeInfo = 0x0121,
Expand Down
Loading
Loading