Last edited 9 months ago

How to calibrate the touchscreen

Applicable for STM32MP13x lines, STM32MP15x lines

Touchscreen is more precise after a calibration, but this action is not mandatory.

Calibration data are erased after each firmware download into STMicroelectronics boards.

The steps described below have to be performed on a running board :

  • Edit and change the value of the touchscreen_calibrator to true in the libinput section of the weston.ini Weston configuration file[1]. #[libinput shall be uncommented.
  vi /etc/xdg/weston/weston.ini
  • Restart weston[2]
  systemctl restart weston-graphical-session
  • List all the touchscreen devices
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
device "/sys/devices/platform/soc/40012000.i2c/i2c-0/0-002a/input/input1/event1" - head "DSI-1"
Warning white.png Warning
If Weston is configured with a "weston" user instead of a "root" user, please use the following commands:
 su -l "weston" -c "your_weston_command"
 su -l "weston" -c "weston-touch-calibrator"
  • Launch calibration with the input of the touch panel
  weston-touch-calibrator /sys/devices/platform/soc/40012000.i2c/i2c-0/0-002a/input/input1/event1

If the calibration succeeds, no message will be displayed on the console. If it fails, the following message will appear:

  weston-touch-calibrator error: Calibration verification failed, too large error.

Touchscreen identifier may vary, depending on the devices that are connected to the board. Recommendation is to unplug all the additional input devices before booting. Otherwise, it is up to You to adapt the command line.

1. References[edit source]