Skip to content

Commit a9ebb69

Browse files
committed
README: Move more into advanced example file
Clean up readme Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 0dde5cd commit a9ebb69

2 files changed

Lines changed: 86 additions & 85 deletions

File tree

EXAMPLES_ADVANCED.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Advanced debugging
22

3+
## Verbosity
4+
5+
To debug, increase the verbosity from the commandline with `-v`.
6+
The verbosity levels are:
7+
8+
| Commandline | Level |
9+
|-------------|--------|
10+
| `-q` | No log |
11+
| None | Error |
12+
| `-v` | Warn |
13+
| `-vv` | Info |
14+
| `-vvv` | Debug |
15+
| `-vvvv` | Trace |
16+
17+
For example it is useful to check which EC driver is used:
18+
19+
```
20+
> framework_tool --kblight -vvv
21+
[DEBUG] Chromium EC Driver: CrosEc
22+
[DEBUG] send_command(command=0x22, ver=0, data_len=0)
23+
Keyboard backlight: 0%
24+
25+
> framework_tool --driver portio --kblight -vvv
26+
[DEBUG] Chromium EC Driver: Portio
27+
[DEBUG] send_command(command=0x22, ver=0, data_len=0)
28+
Keyboard backlight: 0%
29+
```
30+
331
## PD
432

533
### Check PD state
@@ -189,3 +217,58 @@ Capsule Header
189217
Capsule Size: 2180 KB
190218
Type: Framework Retimer23 (Right)
191219
```
220+
221+
## Version Check
222+
223+
Check if the firmware version is what you expect, returns exit code 0 on
224+
succcess, 1 on failure.
225+
226+
```
227+
# Check which devices it's available for
228+
> ./framework_tool --device
229+
[possible values: bios, ec, pd0, pd1, rtm01, rtm23, ac-left, ac-right]
230+
231+
For more information try '--help'
232+
233+
# Successful compare
234+
> ./framework_tool --device bios --compare-version 03.01
235+
Target Version "03.01"
236+
Comparing BIOS version "03.01"
237+
Compared version: 0
238+
> echo $?
239+
0
240+
241+
# Failed compare
242+
> ./framework_tool --device bios --compare-version 03.00
243+
Finished dev [unoptimized + debuginfo] target(s) in 0.05s
244+
Target Version "03.00"
245+
Comparing BIOS version "03.01"
246+
Compared version: 1
247+
Error: "Fail"
248+
249+
> echo $?
250+
1
251+
```
252+
253+
On UEFI Shell:
254+
255+
```
256+
# Check if AC is attached on left side
257+
Shell> fs0:framework_tool.efi --device ac-left --compare-version 1
258+
Target Version "1"
259+
Comparing AcLeft "1"
260+
Comparison Result: 0
261+
# It is
262+
Shell> echo %lasterror%
263+
0x0
264+
265+
# Check if AC is attached on right side
266+
Shell> fs0:framework_tool.efi --device ac-right --compare-version 1
267+
Target Version "1"
268+
Comparing AcLeft "0"
269+
Comparison Result: 1
270+
271+
# It is not
272+
Shell> echo %lasterror%
273+
0x1
274+
```

README.md

Lines changed: 3 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
Rust libraries and tools to interact with the system.
44

55
The tool works on Linux, Windows and the UEFI shell.
6-
Download it from the latest [GH Actions](https://github.com/FrameworkComputer/framework-system/actions?query=branch%3Amain) run on the main branch.
7-
Most features are supported on every "OS". See below for details.
6+
Most features are supported on every "OS".
7+
8+
You can find lots of examples in [EXAMPLES.md](./EXAMPLES.md).
89

910
## Installation
1011

@@ -267,86 +268,3 @@ own EC firmware and flash it.
267268

268269
- [x] Basic unit tests
269270
- [x] Test parsing real binaries
270-
271-
## Version Check
272-
273-
Check if the firmware version is what you expect, returns exit code 0 on
274-
succcess, 1 on failure.
275-
276-
```
277-
# Check which devices it's available for
278-
> ./framework_tool --device
279-
[possible values: bios, ec, pd0, pd1, rtm01, rtm23, ac-left, ac-right]
280-
281-
For more information try '--help'
282-
283-
# Successful compare
284-
> ./framework_tool --device bios --compare-version 03.01
285-
Target Version "03.01"
286-
Comparing BIOS version "03.01"
287-
Compared version: 0
288-
> echo $?
289-
0
290-
291-
# Failed compare
292-
> ./framework_tool --device bios --compare-version 03.00
293-
Finished dev [unoptimized + debuginfo] target(s) in 0.05s
294-
Target Version "03.00"
295-
Comparing BIOS version "03.01"
296-
Compared version: 1
297-
Error: "Fail"
298-
299-
> echo $?
300-
1
301-
```
302-
303-
On UEFI Shell:
304-
305-
```
306-
# Check if AC is attached on left side
307-
Shell> fs0:framework_tool.efi --device ac-left --compare-version 1
308-
Target Version "1"
309-
Comparing AcLeft "1"
310-
Comparison Result: 0
311-
# It is
312-
Shell> echo %lasterror%
313-
0x0
314-
315-
# Check if AC is attached on right side
316-
Shell> fs0:framework_tool.efi --device ac-right --compare-version 1
317-
Target Version "1"
318-
Comparing AcLeft "0"
319-
Comparison Result: 1
320-
321-
# It is not
322-
Shell> echo %lasterror%
323-
0x1
324-
```
325-
326-
## Debugging
327-
328-
To debug, increase the verbosity from the commandline with `-v`.
329-
The verbosity levels are:
330-
331-
| Commandline | Level |
332-
|-------------|--------|
333-
| `-q` | No log |
334-
| None | Error |
335-
| `-v` | Warn |
336-
| `-vv` | Info |
337-
| `-vvv` | Debug |
338-
| `-vvvv` | Trace |
339-
340-
For example it is useful to check which EC driver is used:
341-
342-
```
343-
> framework_tool --kblight -vvv
344-
[DEBUG] Chromium EC Driver: CrosEc
345-
[DEBUG] send_command(command=0x22, ver=0, data_len=0)
346-
Keyboard backlight: 0%
347-
348-
> framework_tool --driver portio --kblight -vvv
349-
[DEBUG] Chromium EC Driver: Portio
350-
[DEBUG] send_command(command=0x22, ver=0, data_len=0)
351-
Keyboard backlight: 0%
352-
```

0 commit comments

Comments
 (0)