Skip to content

Commit fcf0326

Browse files
committed
framework12: Add step-by-step debug instructions
To help users root cause and fix problems. Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 2e4838c commit fcf0326

File tree

1 file changed

+126
-0
lines changed

1 file changed

+126
-0
lines changed

framework12/debugging.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Framework 12 - Debugging
2+
3+
Framework 12 has a couple of features not present on our other systems.
4+
They might not work on some installations, these instructions here help you find the root cause and how to fix it.
5+
6+
## Tablet Mode
7+
8+
Kernel drivers required:
9+
10+
- `pinctrl_tigerlake` (Must be built into the kernel or load first)
11+
- [`soc_button_array`](https://github.com/torvalds/linux/blob/master/drivers/input/misc/soc_button_array.c)
12+
13+
### Check that both modules are loaded
14+
15+
```
16+
> sudo lsmod | grep -e pinctrl_tigerlake -e soc_button_array
17+
pinctrl_tigerlake 24576 0
18+
soc_button_array 28672 5
19+
```
20+
21+
If no, you can load them manually:
22+
23+
```
24+
> sudo modprobe pinctrl_tigerlake soc_button_array
25+
```
26+
27+
### Check that the kernel recognized the tabletmode GPIO
28+
29+
```
30+
> journalctl -k | grep gpio-keys
31+
Feb 27 19:14:00 fedora kernel: input: gpio-keys as /devices/platform/INT33D3:00/gpio-keys.1.auto/input/input17
32+
```
33+
34+
If no, then `pinctrl_tigerlake` might have loaded after `soc_button_array`.
35+
Reload them manually in the right order:
36+
37+
```
38+
sudo rmmod soc_button_array
39+
sudo modprobe soc_button_array
40+
```
41+
42+
To make this permanent you can configure your distribution to load
43+
`pinctrl_tigerlake` in initrd.
44+
45+
### Check that libinput can see tablet mode changes
46+
47+
```
48+
> sudo libinput debug-events | grep SWITCH_TOGGLE
49+
-event13 SWITCH_TOGGLE +0.000s switch tablet-mode state 1
50+
event13 SWITCH_TOGGLE +1.360s switch tablet-mode state 0
51+
```
52+
53+
We have not seen this fail, if the kernel modules are okay, this should work.
54+
If not, please contact Framework.
55+
56+
## Screen Rotation
57+
58+
GNOME, KDE, Windows all rotate the screen only if the system is in tablet mode,
59+
so please check if that's working first.
60+
61+
If you want to rotate in laptop mode, KDE has a setting and GNOME has a plugin to do that.
62+
63+
The kernel driver
64+
[`cros_ec_sensors`](https://github.com/torvalds/linux/blob/master/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c)
65+
reads accelerometer from the EC controller. This is supported on Framework 12
66+
since Linux 6.12.
67+
68+
iio-sensor-proxy interprets that accelerometer data as a screen orientation and
69+
forwards it to GNOME/KDE via dbus.
70+
71+
### Check that the EC driver recognizes the system
72+
73+
```
74+
> sudo dmesg | grep cros_ec
75+
[ 9.014454] cros_ec_lpcs cros_ec_lpcs.0: loaded with quirks 00000001
76+
[ 9.025815] cros_ec_lpcs cros_ec_lpcs.0: Chrome EC device registered
77+
```
78+
79+
If no, likely your kernel is older than 6.12.
80+
81+
### Check that the kernel exposes accelerometer data
82+
83+
```
84+
> cat /sys/bus/iio/devices/iio:device0{name,label,in_accel_{x,y,z}_raw}
85+
cros-ec-accel
86+
accel-display
87+
-192
88+
14400
89+
6672
90+
```
91+
92+
If that is not working, please contact Framework.
93+
94+
### Check that the iio-sensor-proxy daemon is runnning
95+
96+
```
97+
> systemctl status iio-sensor-proxy.service | grep Active
98+
Active: active (running) since Thu 2025-02-27 19:14:02 CST; 19h ago
99+
```
100+
101+
If no, make sure the package is installed and the service is enabled and running.
102+
103+
104+
### Check that the daemon can be accessed and recognizes the sensor
105+
106+
```
107+
> monitor-sensor --accel
108+
Waiting for iio-sensor-proxy to appear
109+
+++ iio-sensor-proxy appeared
110+
=== Has accelerometer (orientation: normal)
111+
Accelerometer orientation changed: right-up
112+
Accelerometer orientation changed: normal
113+
```
114+
115+
If not, you are likely running iio-sensor-proxy 3.7.
116+
A fix has been [merged upstream](https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/merge_requests/400).
117+
Until the next release has reached distributions, you can either downgrade to
118+
3.7 or remove a line in the udev config:
119+
120+
```
121+
sed 's/.*iio-buffer-accel/#&/' /usr/lib/udev/rules.d/80-iio-sensor-proxy.rules | sudo tee /etc/udev/rules.d/80-iio-sensor-proxy.rules
122+
sudo udevadm trigger --settle
123+
sudo systemctl restart iio-sensor-proxy
124+
```
125+
126+
Please see our distribution specific documentation for further details.

0 commit comments

Comments
 (0)