cancel
Showing results for 
Search instead for 
Did you mean: 

libGLESv2.so.2 Error with Qt Application on STM32

nesnes
Associate III

Hi ST Community, @Erwan SZYMANSKI 

I’ve been working on integrating a Qt example from ~/Qt/Examples/Qt-6.7.2/quickcontrols/imagine into my custom Yocto layer for an STM32 board. I created a recipe for this and updated my local.conf accordingly. After building the image and flashing it to my board, I encountered the following error when running the application. I have added my .bb recipe file and local.conf file. (I have qt5 layer installed too)

 

nesnes@nesnes-ABRA-A5-V19-2:~/STM32MPU-Ecosystem-v5.1.0/Distribution-Package/build-openstlinuxweston-stm32mp15-disco$ bitbake automotive
NOTE: Started PRServer with DBfile: /home/nesnes/STM32MPU-Ecosystem-v5.1.0/Distribution-Package/build-openstlinuxweston-stm32mp15-disco/cache/prserv.sqlite3, Address: 127.0.0.1:33289, PID: 89725
Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:00
Loaded 4703 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "2.4.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-ostl-linux-gnueabi"
MACHINE              = "stm32mp15-disco"
DISTRO               = "openstlinux-weston"
DISTRO_VERSION       = "4.2.4-snapshot-20240812"
TUNE_FEATURES        = "arm vfp cortexa7 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
DISTRO_CODENAME      = "mickledore"
ACCEPT_EULA_stm32mp15-disco = "1"
GCCVERSION           = "12.%"
PREFERRED_PROVIDER_virtual/kernel = "linux-stm32mp"
meta-python          
meta-oe              
meta-gnome           
meta-multimedia      
meta-networking      
meta-webserver       = "HEAD:aa5e8edabbc414d8ec1b2ad63c8743c7baf99626"
meta-st-stm32mp      = "HEAD:1f152e07019dc06fd331b4926ec7e76ceae3d259"
meta-st-openstlinux  = "HEAD:2636960b2bead3d1cb294e378e2b06ef8997189e"
meta                 = "HEAD:23b5141400b2c676c806df3308f023f7c04e34e0"
meta-my-layer        = "<unknown>:<unknown>"
meta-st-x-linux-qt   = "v1.0.0:1e51cb49240116fb512deccd8f6bad551918f866"
meta-qt5             = "scarthgap:eb828418264a49b8d00035cb3d7b12fcea3be801"

Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:00
Sstate summary: Wanted 94 Local 94 Mirrors 0 Missed 0 Current 888 (100% match, 100% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 2633 tasks of which 2633 didn't need to be rerun and all succeeded.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 1 seconds
automotive: error while loading shared libraries: libGLESv2.so.2: cannot open shared object file: No such file or directory
root@stm32mp15-disco:~# automotive 
automotive: error while loading shared libraries: libGLESv2.so.2: cannot open shared object file: No such file or directory
root@stm32mp15-disco:~# apt-get install libGLESv2
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package libGLESv2
root@stm32mp15-disco:~# automotive 
automotive: error while loading shared libraries: libGLESv2.so.2: cannot open shared object file: No such file or directory
root@stm32mp15-disco:~# apt-get install libGLESv2.so.2
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package libGLESv2.so.2
E: Couldn't find any package by glob 'libGLESv2.so.2'
E: Couldn't find any package by regex 'libGLESv2.so.2'
root@stm32mp15-disco:~# sudo apt-get install -y libgles2-mesa-dev
-sh: sudo: command not found
root@stm32mp15-disco:~#  apt-get install -y libgles2-mesa-dev
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package libgles2-mesa-dev
root@stm32mp15-disco:~# sudo apt-get install libegl1-mesa
-sh: sudo: command not found
root@stm32mp15-disco:~# apt-get install libgles2-mesa
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package libgles2-mesa
root@stm32mp15-disco:~# apt-get update
Reading package lists... Done
root@stm32mp15-disco:~# apt-cache search libgles2
libgles2-gcnano - Vivante libraries OpenGL ES, OpenVG and EGL (multi backend)
root@stm32mp15-disco:~# apt-get install libgles2-mesa-dev
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package libgles2-mesa-dev
root@stm32mp15-disco:~# apt-get install libgles2-gcnano
Reading package lists... Done
Building dependency tree... Done
libgles2-gcnano is already the newest version (6.4.15+20240206-r0.0).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

 

 

IMAGE_INSTALL += " gettemp"
IMAGE_INSTALL += " automotive"
DISTRO_FEATURES += " wayland"
IMAGE_INSTALL += " opkg grep"  
IMAGE_INSTALL += " libgles2"
IMAGE_INSTALL += " qtbase qtwayland qtquickcontrols2 qtdeclarative gcnano-userland-multi-binary-stm32mp "
CORE_IMAGE_EXTRA_INSTALL += " wayland weston" 
SUMMARY = "QT automotive recipe"
DESCRIPTION = "Recipe to build and install automotive application using Qt"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

# Source files location
SRC_URI = "file://src"

# Define dependencies
DEPENDS += "qtbase qtdeclarative qtquickcontrols2 wayland gcnano-userland-multi-binary-stm32mp"

# Source directory
S = "${WORKDIR}/src"

# Inherit necessary classes
inherit qmake5

# Build steps
do_configure() {
    # Change to the source directory where automotive.pro is located
    cd ${S}

    # Ensure that qmake is run on the correct .pro file
    ${OE_QMAKE_QMAKE} ${S}/automotive.pro
}

do_compile() {
    # Run the build command in the source directory
    cd ${S}
    ${MAKE}
}

# Install steps
do_install() {
    # Create installation directory
    install -d ${D}${bindir}
    
    # Install the compiled binary
    install -m 0755 ${S}/automotive ${D}${bindir}
}

# Specify installed files
FILES_${PN} += "${bindir}/automotive"

# Ensure the correct architecture for cross-compiling
TARGET_ARCH = "arm"

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @nesnes ,
Thanks to this test, my doubt seems to be confirmed. I made the test myself, can you please try to replace your configuration line by exactly :

 

IMAGE_INSTALL:append = " qtbase "

 

On my side, it seems to make the value of IMAGE_INSTALL clean back (see below)

 

IMAGE_INSTALL="    packagegroup-core-boot     packagegroup-base-extended               resize-helper         packagegroup-framework-core-base        packagegroup-framework-tools-base           packagegroup-framework-core             packagegroup-framework-tools                packagegroup-framework-core-extra           packagegroup-optee-core     packagegroup-optee-test                  packagegroup-st-demo           qtbase "

 

Kind regards,
Erwan

PS : I tested the same line with "+=" as you had, and can observe the same issue.

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.

View solution in original post

21 REPLIES 21
Erwan SZYMANSKI
ST Employee

Hello @nesnes ,
Can you please share the content of your /vendor/lib folder on the board file system please ? If you see nothing, are you sure you well accepted the EULA for the GPU when you sourced your Distribution Package.

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.

@Erwan SZYMANSKI I encountered this problem when ı was trying to add an example qt application to the board. when ı build my distributions packet ı didn't have any problem, flashing the board works nicely but when I added the

 

IMAGE_INSTALL_append = " qtbase qtdeclarative qtwayland qtimageformats qtmultimedia"

 

 line to my local.conf and built st-image-weston again after flashing the board nothing works even the simple ls command. I couldn't understand the problem.Screenshot from 2024-08-13 17-39-35.png

 

Screenshot from 2024-08-13 17-39-40.png

 

Screenshot from 2024-08-13 17-39-46.png

 

Screenshot from 2024-08-13 17-40-03.png

 

Screenshot from 2024-08-14 09-21-41.png

 

@nesnes ,
2 things to notice :

  • The "_append" command is not anymore a syntax supported by Yocto, instead you need to use ":append"
  • In your screenshot I do not see any error. If Yocto does nothing, this is because it detects it has nothing more to do and everything you ask to install is already on your image.

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.

@Erwan SZYMANSKI 

I write in the right syntax when writing local conf like in the last picture.

When I build the distribution package, everything works fine, and the image flashes to the board without any issues. However, after I add the line 

 

 

IMAGE_INSTALL += "qtbase qtdeclarative qtwayland qtimageformats qtmultimedia"

 

 

to the local.conf file and rebuild the st-image-weston, the number of files in the build drops from around 8000 to 5000. Although the build process doesn't throw any errors, when I flash the board with this image, it becomes stuck on the boot screen, and no commands, not even ls, work. Why could this be happening?

 

Instead of adding them in IMAGE_INSTALL += should ı do something else to add them to my image ?

 

The reason why I am trying to this is that I just want to learn how add my example qt application to my board (with adding to my image with my own layer without licensing ) .

@nesnes ,
Just by looking at your issue like that, I do not have a lot of idea.

What is sure is that the "_append" will do absolutely nothing.
Maybe try to add a space after your qtmultimedia " in your IMAGE_INSTALL line. Yocto will just concatenate the variable and so maybe something is going wrong, but I am not sure about that.

If it does not correct anything, I advice you to restart from scratch, with the default Distribution Package we provide that works, then step by step add your part inside and see what provoke the bad situation.

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.

@Erwan SZYMANSKI I did restart from scratch, with the default Distribution Package and it works fine , but it doesnt work when I add

 

IMAGE_INSTALL += "qbase"

 

  when I add this line Tasks Summary: Attempted 7925 tasks dropping to 5555 and when I try to flash , I do it without error but yocto  doesnt work on the board.But when I remove the line it works nicely again.

@nesnes ,
Above I told you about the space and the concatenation in this variable, I would like to see space before and after qtbase : IMAGE_INSTALL += " qbase "

To be sure, use the following syntax :

IMAGE_INSTALL:append = " \
        qtbase \
        xxxx \
        xxxxx \
        xxxxxx \
"

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.

@Erwan SZYMANSKII did try it with those syntax nothing changed.

@nesnes ,
Like this, I do not see what happens. If Yocto consider he has less tasks to do, in a way or another, something remove some packages to deploy in the final image, that can explain why you see some things missing when you boot up the board.

But without your complete setup, I will have some trouble to help more.

Can you explain from the very beginning the step you follow ? 

  • Ecosystem OpenSTLinux used
  • Add X-LINUX-QT layer or not ? 
  • You DISTRO and MACHINE, as well as the image you build (I saw st-image-qt )
  • Your personal things added into the config (local.conf modification, personal layer etc...)

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.