summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Peress <peress@google.com>2022-02-13 20:57:26 -0700
committerCommit Bot <commit-bot@chromium.org>2022-02-18 06:10:41 +0000
commit95a4970bb46a27a5454eeb96a677001a451a58c8 (patch)
treed8c57b4ada561feb7839ca38701ef2824efce64a
parentecfaa471c2fafab98967fbd6282b2d25ccff5143 (diff)
downloadchrome-ec-95a4970bb46a27a5454eeb96a677001a451a58c8.tar.gz
docs: zephyr: Add testing information about motionsense
Add some general guidelines for tests that can be run to make sure that motionsense was initialized correctly. BRANCH=none BUG=b:208437221 TEST=none Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I06c0bb77373e149bca8eaee8d08a0581bd04fcab Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3459248 Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--docs/zephyr/zephyr_motionsense.md27
1 files changed, 26 insertions, 1 deletions
diff --git a/docs/zephyr/zephyr_motionsense.md b/docs/zephyr/zephyr_motionsense.md
index b03804f097..dc55825125 100644
--- a/docs/zephyr/zephyr_motionsense.md
+++ b/docs/zephyr/zephyr_motionsense.md
@@ -136,7 +136,31 @@ Additional information about the task priority can be found in
## Testing and Debugging
-*Provide any tips for testing and debugging the EC feature.*
+Properly debugging the sensor framework generally involves one of the following:
+
+* If the device is a convertible (laptop/tablet) flip the screen over and make
+ sure that screen rotations work.
+* In the EC console test the following commands:
+ * `accelrange id [data [roundup]]` where the `id` is the sensor number. If
+ `data` is not provided, then this command will perform a read and print the
+ range of the motion sensor. Otherwise, it will set the range to the nearest
+ `data` value depending on `roundup` being either `0` or `1`.
+ * `accelres id [data [roundup]]` where the `id` is the sensor number. If
+ `data` is not provided, then this command will perform a read and print the
+ resolution of the motion sensor. Otherwise, it will set the resolution to
+ the nearest `data` value depending on `roundup` being either `0` or `1`.
+ * `accelrate id [data [roundup]]` where the `id` is the sensor number. If
+ `data` is not provided, then this command will perform a read and print the
+ ODR of the motion sensor. Otherwise, it will set the ODR to the nearest
+ `data` value depending on `roundup` being either `0` or `1`.
+ * `accelread id [n]` where the `id` is the sensor number. If `n` is provided,
+ the sensor will be read `n` times. Otherwise, only a single read operation
+ will take place.
+* From the kernel root shell, test the following commands:
+ * `ectool motionsense` to print all the motion data.
+ * `ectool lid_angle` to verify that the rotation matrices are set correctly
+ for the lid and base accelerometers.
+ * See [ectool] for additional commands or run `ectool help motionsense`.
## Example
@@ -165,3 +189,4 @@ Reference this link in your text by matching the text in brackets exactly.
[GMR TABLET MODE]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_GMR_TABLET_MODE"&ss=chromiumos
[ACCEL INFO CMD]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_CONSOLE_CMD_ACCEL_INFO"&ss=chromiumos
[ACCEL SPOOF CMD]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_CONSOLE_CMD_ACCEL_SPOOF"&ss=chromiumos
+[ectool]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/util/ectool.c;?q=function:ms_help&ss=chromiumos