{"id":21380816,"url":"https://github.com/frameworkcomputer/framework-system","last_synced_at":"2025-07-13T13:30:48.162Z","repository":{"id":187296175,"uuid":"673133166","full_name":"FrameworkComputer/framework-system","owner":"FrameworkComputer","description":"Rust libraries and tools to interact with the Framework Computer systems","archived":false,"fork":false,"pushed_at":"2024-05-23T01:56:03.000Z","size":1518,"stargazers_count":90,"open_issues_count":9,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-05-23T02:46:13.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FrameworkComputer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support-matrices.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-01T00:32:11.000Z","updated_at":"2024-05-30T02:02:31.978Z","dependencies_parsed_at":"2023-10-23T03:30:54.621Z","dependency_job_id":"55b1942f-5d92-4e6c-a278-690f06ee3091","html_url":"https://github.com/FrameworkComputer/framework-system","commit_stats":null,"previous_names":["frameworkcomputer/framework-system"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrameworkComputer%2Fframework-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrameworkComputer%2Fframework-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrameworkComputer%2Fframework-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrameworkComputer%2Fframework-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FrameworkComputer","download_url":"https://codeload.github.com/FrameworkComputer/framework-system/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225885798,"owners_count":17539640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T10:42:51.422Z","updated_at":"2025-07-13T13:30:48.149Z","avatar_url":"https://github.com/FrameworkComputer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Framework System\n\nRust libraries and tools to interact with the system.\n\nThe tool works on Linux, Windows and the UEFI shell.\nDownload it from the latest [GH Actions](https://github.com/FrameworkComputer/framework-system/actions?query=branch%3Amain) run on the main branch.\nMost features are supported on every \"OS\". See below for details.\n\n## Features\n\nTo check which features are supported on which OS and platform,\nsee the [Support Matrices](support-matrices.md).\n\n###### Operating System Support\n\nThe following operating environments are supported.\n\n- Linux\n- Windows\n- UEFI\n- FreeBSD\n\nMost functionality depends communication with the EC.\nFor Linux and Windows there are dedicated drivers.\nOn UEFI and FreeBSD raw port I/O is used - on Linux this can also be used as a fallback, if the driver is not available or not working.\n\n|                     | Port I/O | Linux | Windows |\n|---------------------|----------| ------|---------|\n| Framework 12        |          |       |         |\n| Intel Core 12th Gen | Yes      | [6.12](https://github.com/torvalds/linux/commit/62be134abf4250474a7a694837064bc783d2b291) | Yes     |\n| Framework 13        |          |       |         |\n| Intel Core 11th Gen | Yes      | [6.11](https://github.com/torvalds/linux/commit/04ca0a51f1e63bd553fd4af8e9af0fe094fa4f0a) | Not yet |\n| Intel Core 12th Gen | Yes      | [6.13](https://github.com/torvalds/linux/commit/dcd59d0d7d51b2a4b768fc132b0d74a97dfd6d6a) | Not yet |\n| Intel Core 13th Gen | Yes      | [6.13](https://github.com/torvalds/linux/commit/dcd59d0d7d51b2a4b768fc132b0d74a97dfd6d6a) | Not yet |\n| AMD Ryzen 7040      | Yes      | [6.10](https://github.com/torvalds/linux/commit/c8f460d991df93d87de01a96b783cad5a2da9616) | Soon    |\n| Intel Core Ultra 1S | Yes      | [6.12](https://github.com/torvalds/linux/commit/62be134abf4250474a7a694837064bc783d2b291) | Soon    |\n| AMD Ryzen AI 300    | Yes      | [6.12](https://github.com/torvalds/linux/commit/62be134abf4250474a7a694837064bc783d2b291) | Yes     |\n| Framework 16        |          |       |         |\n| AMD Ryzen 7040      | Yes      | [6.10](https://github.com/torvalds/linux/commit/c8f460d991df93d87de01a96b783cad5a2da9616) | Soon    |\n| Framework Desktop   |          |       |         |\n| AMD Ryzen AI Max    | Yes      | [6.15](https://github.com/torvalds/linux/commit/d83c45aeec9b223fe6db4175e9d1c4f5699cc37a) | Yes     |\n\n###### Firmware Information\n\n  - [x] Show system information\n    - [x] ESRT table (UEFI, Linux, FreeBSD only) (`--esrt`)\n    - [x] SMBIOS\n  - [x] Get firmware version from binary file\n    - [x] EC (Legacy and Zephyr based) (`--ec-bin`)\n    - [x] CCG5 PD (11th Gen TigerLake) (`--pd-bin`)\n    - [x] CCG6 PD (Intel systems, Framework Desktop) (`--pd-bin`)\n    - [x] CCG8 PD (AMD Laptops) (`--pd-bin`)\n    - [x] H2O BIOS Capsule (`--h2o-capsule`)\n      - [x] BIOS Version\n      - [x] EC Version\n      - [x] CCG5/CCG6/CCG8 PD Version\n    - [x] UEFI Capsule (`--capsule`)\n  - [x] Parse metadata from capsule binary\n    - [x] Determine type (GUID) of capsule binary\n    - [x] Extract bitmap image from winux capsule to file\n  - [x] Get firmware version from system (`--versions`)\n    - [x] BIOS\n    - [x] EC\n    - [x] PD Controller\n    - [x] ME (Only on Linux)\n    - [x] Retimer\n    - [x] Touchpad (Linux, Windows, FreeBSD, not UEFI)\n    - [x] Touchscreen (Linux, Windows, FreeBSD, not UEFI)\n  - [x] Get Expansion Card Firmware (Not on UEFI so far)\n    - [x] HDMI Expansion Card (`--dp-hdmi-info`)\n    - [x] DisplayPort Expansion Card (`--dp-hdmi-info`)\n    - [x] Audio Expansion Card (`--audio-card-info`)\n  - [x] Update Expansion Card Firmware (Not on UEFI so far)\n    - [x] HDMI Expansion Card (`--dp-hdmi-update`)\n    - [x] DisplayPort Expansion Card (`--dp-hdmi-update`)\n    - [ ] Audio Expansion Card\n\n###### System Status\n\nAll of these need EC communication support in order to work.\n\n- [x] Get information about battery/AC (`--power`)\n- [x] Get information about USB-C PD ports (`--pdorts`)\n- [x] Get information about CCGX PD Controllers (`--pd-info`)\n- [x] Show status of intrusion switches (`--intrusion`)\n- [x] Show status of privacy switches (`--privacy`)\n- [x] Check recent EC console output (`--console recent`)\n\n###### Changing settings\n\n- [x] Get and set keyboard brightness (`--kblight`)\n- [x] Get and set battery charge limit (`--charge-limit`)\n- [x] Get and set fingerprint LED brightness (`--fp-brightness`, `--fp-led-level`)\n- [x] Override tablet mode, instead of follow G-Sensor and hall sensor (`--tablet-mode`)\n- [x] Disable/Enable touchscreen (`--touchscreen-enable`)\n\n###### Communication with Embedded Controller\n\n- [x] Framework Laptop 12 (Intel 13th Gen)\n- [x] Framework Laptop 13 (Intel 11-13th Gen)\n- [x] Framework Laptop 13 (AMD Ryzen 7080)\n- [x] Framework Laptop 13 (AMD Ryzen AI 300)\n- [x] Framework Laptop 16 (AMD Ryzen 7080)\n- [x] Framework Desktop (AMD Ryzen AI Max 300)\n- [x] Port I/O communication on Linux\n- [x] Port I/O communication in UEFI\n- [x] Port I/O communication on FreeBSD\n- [x] Using `cros_ec` driver in Linux kernel\n- [x] Using [Framework EC Windows driver](https://github.com/FrameworkComputer/crosecbus) based on [coolstar's](https://github.com/coolstar/crosecbus)\n- [x] Using [DHowett's Windows CrosEC driver](https://github.com/DHowett/FrameworkWindowsUtils)\n\n## Prerequisites\n\nOnly [Rustup](https://rustup.rs/) is needed. Based on `rust-toolchain.toml` it\nwill install the right toolchain and version for this project.\n\n## Building\n\nMSRV (Minimum Supported Rust Version):\n\n- 1.74 for Linux/Windows\n- 1.74 for UEFI\n\n```sh\n# Running linter\ncargo clippy\n\n# Running autoformatter as a check\ncargo fmt --check\n\n# Fixing format issues\ncargo fmt\n\n# Building the library and tool\ncargo build\n\n# Building only the library\ncargo build -p framework_lib\n\n# Building only the tool\ncargo build -p framework_tool\nls -l target/debug/framework_tool\n\n# Build the UEFI application\n# Can't be built with cargo! That's why we need to exclude it in the other commands.\nmake -C framework_uefi\nls -l framework_uefi/build/x86_64-unknown-uefi/boot.efi\n```\n\n### Dependencies\n\n```\n# NixOS\nnix-shell --run fish -p cargo systemd udev hidapi pkg-config\ndirenv shell\n```\n\n## Install local package\n\n```\n\u003e cargo install --path framework_tool\n\u003e which framework_tool\n/home/zoid/.cargo/bin/framework_tool\n```\n\n## Running\n\nRun without any arguments to see the help:\n\n```\n\u003e cargo run\nSwiss army knife for Framework laptops\n\nUsage: framework_tool [OPTIONS]\n\nOptions:\n  -v, --verbose...                  More output per occurrence\n  -q, --quiet...                    Less output per occurrence\n      --versions                    List current firmware versions version\n      --esrt                        Display the UEFI ESRT table\n      --power                       Show current power status (battery and AC)\n      --pdports                     Show information about USB-C PD ports\n      --info                        Show info from SMBIOS (Only on UEFI)\n      --pd-info                     Show details about the PD controllers\n      --dp-hdmi-info                Show details about connected DP or HDMI Expansion Cards\n      --dp-hdmi-update \u003cUPDATE_BIN\u003e Update the DisplayPort or HDMI Expansion Card\n      --audio-card-info             Show details about connected Audio Expansion Cards (Needs root privileges)\n      --privacy                     Show privacy switch statuses (camera and microphone)\n      --pd-bin \u003cPD_BIN\u003e             Parse versions from PD firmware binary file\n      --ec-bin \u003cEC_BIN\u003e             Parse versions from EC firmware binary file\n      --capsule \u003cCAPSULE\u003e           Parse UEFI Capsule information from binary file\n      --dump \u003cDUMP\u003e                 Dump extracted UX capsule bitmap image to a file\n      --h2o-capsule \u003cH2O_CAPSULE\u003e   Parse UEFI Capsule information from binary file\n      --intrusion                   Show status of intrusion switch\n      --inputdeck                   Show status of the input deck\n      --input-deck-mode \u003cINPUT_DECK_MODE\u003e\n          Set input deck power mode [possible values: auto, off, on] (Framework 16 only) [possible values: auto, off, on]\n      --expansion-bay               Show status of the expansion bay (Framework 16 only)\n      --charge-limit [\u003cCHARGE_LIMIT\u003e]\n          Get or set max charge limit\n      --get-gpio [\u003cGET_GPIO\u003e]\n          Get GPIO value by name or all, if no name provided\n      --fp-led-level [\u003cFP_LED_LEVEL\u003e]\n          Get or set fingerprint LED brightness level [possible values: high, medium, low, ultra-low, auto]\n      --fp-brightness [\u003cFP_BRIGHTNESS\u003e]\n          Get or set fingerprint LED brightness percentage\n      --kblight [\u003cKBLIGHT\u003e]         Set keyboard backlight percentage or get, if no value provided\n      --tablet-mode \u003cTABLET_MODE\u003e   Set tablet mode override [possible values: auto, tablet, laptop]\n      --touchscreen-enable \u003cTOUCHSCREEN_ENABLE\u003e\n          Enable/disable touchscreen [possible values: true, false]\n      --console \u003cCONSOLE\u003e           Get EC console, choose whether recent or to follow the output [possible values: recent, follow]\n      --reboot-ec \u003cREBOOT_EC\u003e       Control EC RO/RW jump [possible values: reboot, jump-ro, jump-rw, cancel-jump, disable-jump]\n      --hash \u003cHASH\u003e                 Hash a file of arbitrary data\n      --driver \u003cDRIVER\u003e             Select which driver is used. By default portio is used [possible values: portio, cros-ec, windows]\n      --pd-addrs \u003cPD_ADDRS\u003e \u003cPD_ADDRS\u003e\n          Specify I2C addresses of the PD chips (Advanced)\n      --pd-ports \u003cPD_PORTS\u003e \u003cPD_PORTS\u003e\n          Specify I2C ports of the PD chips (Advanced)\n  -t, --test                        Run self-test to check if interaction with EC is possible\n  -h, --help                        Print help information\n```\n\nMany actions require root. First build with cargo and then run the binary with sudo:\n\n```sh\ncargo build \u0026\u0026 sudo ./target/debug/framework_tool\n```\n\n###### Running on Windows\n\nOn newly released systems since 2025 the Framework driver installer includes the EC driver.\nThis includes Framework 12, Framework 13 AMD Ryzen AI 300, Framework Desktop.\n\nPrevious platforms will be enabled next.\n\nInstalling: `winget install FrameworkComputer.framework_tool`\n\n##### Running on ChromeOS\n\nThe application can run on ChromeOS but most commands rely on custom host\ncommands that we built into the EC firmware of non-Chromebook Framework laptops.\nIn theory you could add those patches to the Chromebook platform, build your\nown EC firmware and flash it.\n\n## Tests\n\n- [x] Basic unit tests\n- [x] Test parsing real binaries\n\n## Version Check\n\nCheck if the firmware version is what you expect, returns exit code 0 on\nsucccess, 1 on failure.\n\n```\n# Check which devices it's available for\n\u003e ./framework_tool --device\n  [possible values: bios, ec, pd0, pd1, rtm01, rtm23, ac-left, ac-right]\n\nFor more information try '--help'\n\n# Successful compare\n\u003e ./framework_tool --device bios --compare-version 03.01\nTarget Version \"03.01\"\nComparing BIOS version \"03.01\"\nCompared version:   0\n\u003e echo $?\n0\n\n# Failed compare\n\u003e ./framework_tool --device bios --compare-version 03.00\n    Finished dev [unoptimized + debuginfo] target(s) in 0.05s\nTarget Version \"03.00\"\nComparing BIOS version \"03.01\"\nCompared version:   1\nError: \"Fail\"\n\n\u003e echo $?\n1\n```\n\nOn UEFI Shell:\n\n```\n# Check if AC is attached on left side\nShell\u003e fs0:framework_tool.efi --device ac-left --compare-version 1\nTarget Version \"1\"\nComparing AcLeft \"1\"\nComparison Result: 0\n# It is\nShell\u003e echo %lasterror%\n0x0\n\n# Check if AC is attached on right side\nShell\u003e fs0:framework_tool.efi --device ac-right --compare-version 1\nTarget Version \"1\"\nComparing AcLeft \"0\"\nComparison Result: 1\n\n# It is not\nShell\u003e echo %lasterror%\n0x1\n```\n\n## Debugging\n\nTo debug, increase the verbosity from the commandline with `-v`.\nThe verbosity levels are:\n\n| Commandline | Level  |\n|-------------|--------|\n| `-q`        | No log |\n| None        | Error  |\n| `-v`        | Warn   |\n| `-vv`       | Info   |\n| `-vvv`      | Debug  |\n| `-vvvv`     | Trace  |\n\nFor example it is useful to check which EC driver is used:\n\n```\n\u003e framework_tool --kblight -vvv\n[DEBUG] Chromium EC Driver: CrosEc\n[DEBUG] send_command(command=0x22, ver=0, data_len=0)\nKeyboard backlight: 0%\n\n\u003e framework_tool --driver portio --kblight -vvv\n[DEBUG] Chromium EC Driver: Portio\n[DEBUG] send_command(command=0x22, ver=0, data_len=0)\nKeyboard backlight: 0%\n```\n\n## FreeBSD\n\n```\nsudo pkg install hidapi\n\n# Build the library and tool\ncargo build\n\n# Running the tool\ncargo run\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fframeworkcomputer%2Fframework-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fframeworkcomputer%2Fframework-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fframeworkcomputer%2Fframework-system/lists"}