Skip to main content
MWoło.2
Senior III
July 12, 2023
Solved

qt5 stm32mp135

  • July 12, 2023
  • 2 replies
  • 3171 views

Hi,

I encounter a performance issue on the qt5 application on STM32MP135. I build a simple application with three plaintextedit objects showing temperature with 1s period from ds18b20. Everything compiles well and works, but the refreshing temperature on plaintextedit consumes 80% of the CPU (only refreshing after that go to 10% or less)

Maybe someone has a similar problem to my. The same application on STM32MP157 works perfectly response on the screen and consumes only 10 to 20% in peak on CPU load. 

In my opinion, something is wrong with the compilation options

I built it like for STM32MP157 without accepting EULA (this model has no graphics on board).

 

bitbake -k st-example-image-qt -c populate_sdk
bitbake -k st-example-image-qt

 

 Thanks for any hints

BR

Michal

This topic has been closed for replies.
Best answer by Erwan SZYMANSKI

Hello @MWoło.2 ,
Different things to mention. MP157 has a GPU while MP135 does not have, that already make a huge difference.
But that is not all. In fact, as MP13 has no GPU, it can try to pass through MESA libraries that can take a lot of resources.
To have the best performances that the MP13 can offer, I recommend the following modifications:

- In Yocto, add a qtbase_git.bbappend to give QT5 a new config flags:
qtbase_git.bbappend:

QT_CONFIG_FLAGS += " -linuxfb "

Then to run your application, I advice you a script that export different variable that will help to have better performances. Inside them, you also ask to use the linuxfb  platform that you ask to add at qt5 compilation just before:

launch_script.sh:

#!/bin/sh
export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
export QT_QPA_EGLFS_KMS_CONFIG=/home/root/config/qt_config.json
#export QT_FONT_DPI=96
#export QT_QPA_EGLFS_HIDECURSOR=1
export QT_QPA_EGLFS_KMS_ATOMIC=1
#export QML2_IMPORT_PATH=~/imports/
#export PATH=/usr/local/qt5-install/bin/:/usr/local/apitrace/bin:$PATH
export QSG_NO_DEPTH_BUFFER=1
export QSG_NO_STENCIL_BUFFER=1
export QSG_NO_CLEAR_BUFFERS=1
export QT_QPA_PLATFORM=linuxfb # because the default built into Qt is eglfs
export QT_QPA_FB_DRM=1 # otherwise it uses /dev/fbX which doesn't exist
export QT_QUICK_BACKEND=software
#export QT_QPA_EGLFS_DEBUG=1

sleep 1
psplash-drm-quit
sleep 1
(cd <your_bin_folder> && ./<your_app>)

I supposed that you went through the EGLFS image, that is the recommended one on MP13 instead of qtwayland

I hope that it well improve your perfs,
Kind regards,
Erwan.

2 replies

Erwan SZYMANSKI
Erwan SZYMANSKIBest answer
Technical Moderator
July 12, 2023

Hello @MWoło.2 ,
Different things to mention. MP157 has a GPU while MP135 does not have, that already make a huge difference.
But that is not all. In fact, as MP13 has no GPU, it can try to pass through MESA libraries that can take a lot of resources.
To have the best performances that the MP13 can offer, I recommend the following modifications:

- In Yocto, add a qtbase_git.bbappend to give QT5 a new config flags:
qtbase_git.bbappend:

QT_CONFIG_FLAGS += " -linuxfb "

Then to run your application, I advice you a script that export different variable that will help to have better performances. Inside them, you also ask to use the linuxfb  platform that you ask to add at qt5 compilation just before:

launch_script.sh:

#!/bin/sh
export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
export QT_QPA_EGLFS_KMS_CONFIG=/home/root/config/qt_config.json
#export QT_FONT_DPI=96
#export QT_QPA_EGLFS_HIDECURSOR=1
export QT_QPA_EGLFS_KMS_ATOMIC=1
#export QML2_IMPORT_PATH=~/imports/
#export PATH=/usr/local/qt5-install/bin/:/usr/local/apitrace/bin:$PATH
export QSG_NO_DEPTH_BUFFER=1
export QSG_NO_STENCIL_BUFFER=1
export QSG_NO_CLEAR_BUFFERS=1
export QT_QPA_PLATFORM=linuxfb # because the default built into Qt is eglfs
export QT_QPA_FB_DRM=1 # otherwise it uses /dev/fbX which doesn't exist
export QT_QUICK_BACKEND=software
#export QT_QPA_EGLFS_DEBUG=1

sleep 1
psplash-drm-quit
sleep 1
(cd <your_bin_folder> && ./<your_app>)

I supposed that you went through the EGLFS image, that is the recommended one on MP13 instead of qtwayland

I hope that it well improve your perfs,
Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
MWoło.2
MWoło.2Author
Senior III
July 14, 2023

Hi Erwan

I try and let You know.

Thanks

Best Regards

Michal

MWoło.2
MWoło.2Author
Senior III
July 31, 2023

Hi Erwan,

working perfectly, I just commented this line with json. Really huge difference between running application using script and without.

Thanks a lot

BR

Michał