Skip to content

More examples #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 7, 2025
Merged
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
84 changes: 81 additions & 3 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

## Check firmware versions

### BIOS (Mainboard, UEFI, EC, PD)

Example on Framework 13 AMD Ryzen AI 300 Series:

```
> framework_tool --versions
Mainboard Hardware
Type: Laptop 13 (AMD Ryzen AI 300 Series)
Revision: MassProduction
UEFI BIOS
Version: 03.00
Release Date: 03/10/2025
EC Firmware
Build version: "lilac-3.0.0-1541dc6 2025-05-05 11:31:24 zoid@localhost"
RO Version: "lilac-3.0.0-1541dc6"
RW Version: "lilac-3.0.0-1541dc6"
Current image: RO
PD Controllers
Right (01)
Main: 0.0.0E (Active)
Backup: 0.0.0E
Left (23)
Main: 0.0.0E (Active)
Backup: 0.0.0E
[...]
```

### Camera (Framework 12, Framework 13, Framework 16)

Example on Framework 12:
Expand Down Expand Up @@ -128,21 +155,33 @@ Positions:
## Check temperatures and fan speed

```
> sudo ./target/debug/framework_tool --thermal
> sudo framework_tool --thermal
F75303_Local: 43 C
F75303_CPU: 44 C
F75303_DDR: 39 C
APU: 62 C
Fan Speed: 0 RPM
```

## Check sensors (ALS and G-Sensor)
## Check sensors

### Ambient Light (Framework 13, Framework 16)

```
> sudo ./target/debug/framework_tool --sensors
> sudo framework_tool --sensors
ALS: 76 Lux
```

### Accelerometer (Framework 12)
```
> sudo framework_tool --sensors
ALS: 0 Lux
Accelerometers:
Lid Angle: 122 Deg
Sensor 1: X=+0.00G Y=+0.84G, Z=+0.52G
Sensor 2: X=-0.03G Y=+0.00G, Z=+1.01G
```

## Set custom fan duty/RPM

```
Expand Down Expand Up @@ -296,6 +335,45 @@ Battery Status
> sudo framework_tool --charge-current-limit 2000 80
```

## EC Console

```
# Get recent EC console logs and watch for more
> framework_tool.exe --console follow
[53694.741000 Battery 62% (Display 61.1 %) / 3h:18 to empty]
[53715.010000 Battery 62% (Display 61.0 %) / 3h:21 to empty]
[53734.281200 Battery 62% (Display 60.9 %) / 3h:18 to empty]
[53738.037200 Battery 61% (Display 60.9 %) / 3h:6 to empty]
[53752.301500 Battery 61% (Display 60.8 %) / 3h:15 to empty]
```

## Keyboard backlight

```
# Check current keyboard backlight brightness
> framework_tool.exe --kblight
Keyboard backlight: 5%

# Set keyboard backlight brightness
# Off
> framework_tool.exe --kblight 0
# 20%
> framework_tool.exe --kblight 20
```

## RGB LED (Framework Desktop)

```
# To set three LEDs to red, green, blue
sudo framework_tool --rgbkbd 0 0xFF0000 0x00FF00 0x0000FF

# To clear 8 LEDs
sudo framework_tool --rgbkbd 0 0 0 0 0 0 0 0 0

# Just turn the 3rd LED red
sudo framework_tool --rgbkbd 2 0xFF0000
```

## Stylus (Framework 12)

```
Expand Down
35 changes: 19 additions & 16 deletions framework_lib/src/power.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl fmt::Display for AccelData {
let x = (self.x as f32) / quarter;
let y = (self.y as f32) / quarter;
let z = (self.z as f32) / quarter;
write!(f, "X: {:.2}G Y: {:.2}G, Z: {:.2}G", x, y, z)
write!(f, "X={:+.2}G Y={:+.2}G, Z={:+.2}G", x, y, z)
}
}

Expand Down Expand Up @@ -288,22 +288,25 @@ pub fn print_sensors(ec: &CrosEc) {
let accel_1 = ec.read_memory(EC_MEMMAP_ACC_DATA + 2, 0x06).unwrap();
let accel_2 = ec.read_memory(EC_MEMMAP_ACC_DATA + 8, 0x06).unwrap();

println!("Accelerometers:");
println!(" Status Bit: {} 0x{:X}", acc_status, acc_status);
println!(" Present: {}", (acc_status & 0x80) > 0);
println!(" Busy: {}", (acc_status & 0x8) > 0);
print!(" Lid Angle: ");
if lid_angle == LID_ANGLE_UNRELIABLE {
println!("Unreliable");
} else {
println!("{} Deg", lid_angle);
let present = (acc_status & 0x80) > 0;
if present {
println!("Accelerometers:");
debug!(" Status Bit: {} 0x{:X}", acc_status, acc_status);
debug!(" Present: {}", present);
debug!(" Busy: {}", (acc_status & 0x8) > 0);
print!(" Lid Angle: ");
if lid_angle == LID_ANGLE_UNRELIABLE {
println!("Unreliable");
} else {
println!("{} Deg", lid_angle);
}
println!(" Sensor 1: {}", AccelData::from(accel_1));
println!(" Sensor 2: {}", AccelData::from(accel_2));
// Accelerometers
// Lid Angle: 26 Deg
// Sensor 1: 00.00 X 00.00 Y 00.00 Z
// Sensor 2: 00.00 X 00.00 Y 00.00 Z
}
println!(" Sensor 1: {}", AccelData::from(accel_1));
println!(" Sensor 2: {}", AccelData::from(accel_2));
// Accelerometers
// Lid Angle: 26 Deg
// Sensor 1: 00.00 X 00.00 Y 00.00 Z
// Sensor 2: 00.00 X 00.00 Y 00.00 Z
}

pub fn print_thermal(ec: &CrosEc) {
Expand Down
Loading