This is the documentation for the latest (main) development branch of HPM SDK. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

14.3. Touch screen control of BLDC

14.3.1. Overview

bldc_littlevgl_foc control of DC brushless motor by operating the touch screen.

  • Use the FOC control algorithm

  • Use the littlevgl motor drive library

  • Touch screen operation to control motor position and speed

  • Real-time display of motor speed and position

14.3.2. Configurations

14.3.3. Code Options

  • Add sdk_compile_options("-mabi=ilp32f") to the project’s CMakeLists.txt to get a higher performance


This code does not support any compilation optimization, please turn off compilation optimization

14.3.4. Running the demo

After the initialization operation, the screen will display the interface, click on the screen for speed and position control, and the screen will show the speed and position information.


  • After the motor is powered on, it will first perform the “alignment” action. If the motor is disturbed at this time, it will produce a jitter.

  • Pay attention to the current size, when abnormalities occur, please cut off the power at any time