Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Adding Qt stack to embedded linux kerenel
Forum Updated to NodeBB v4.3 + New Features

Adding Qt stack to embedded linux kerenel

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
32 Posts 4 Posters 12.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS SGaist

    What SDK is it exactly ?

    embdevE Offline
    embdevE Offline
    embdev
    wrote on last edited by
    #6

    @SGaist We're using HI3536 network video recorder (NVR) SDK for development.

    1 Reply Last reply
    0
    • embdevE Offline
      embdevE Offline
      embdev
      wrote on last edited by embdev
      #7

      for testing purposes, is it possible to install the qt-everywhere-opensource-src-4.8.6 on the host computer, and then run the qt demos on my embedded Linux (target board) via NFS to retrieve the bin files from my host computer?

      I tried this method but I get the following error:
      0_1472177075423_upload-895c0b3f-dea9-48a7-a5cc-6387e11b64c2

      1 Reply Last reply
      0
      • QojoteQ Offline
        QojoteQ Offline
        Qojote
        wrote on last edited by
        #8

        You really have to cross compile the Qt libraries for your target device. Therefore you need all the tools like *-g++.
        Its quite useful for development when your whole rootfs is mounted via NFS.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #9

          @Qojote The cross-compiling is correct. However, the cross-compiler doesn't come with the target rootfs. It's part of the host tools usually provided with the SDK.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • QojoteQ Offline
            QojoteQ Offline
            Qojote
            wrote on last edited by
            #10

            Correct. It was just a hint for the future.

            1 Reply Last reply
            0
            • embdevE Offline
              embdevE Offline
              embdev
              wrote on last edited by
              #11

              ok, fyi, I've previously flashed in the vendor kernel image, rootfs and uboot. So right now i'll need to use the vendor's CC to make / compile all the Qt files in Qt-everywhere-opensource package?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #12

                Yes, usually, the SDK provides the cross-compiler or if not, a mean to get one. What you will also need is the "dev" version of the packages you installed on your rootfs in order to get the dependencies needed for Qt and your application (e.g. OpenSSL)

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • embdevE Offline
                  embdevE Offline
                  embdev
                  wrote on last edited by embdev
                  #13

                  I managed to compiled executable files for my embedded Linux board using arms arch. using my SDK compiler (using the Qt-everywhere-opensource-4.8.6).

                  FYI, because i'm just want to run a quick test for the Qt demos, i'm actually accessing the following files below (i.e. framebuffer; deform; books) on my Putty terminal, via my NSF that is linked to the host computer running on Ubuntu.

                  In addition, my lib folder in my embedded development board does nt contain the Qt lib files, but those Qt lib files are instead residing in my NSF folder. Do I also need to append my .profile file in my embedded Linux to point to the NSF path for the required lib files?

                  Will these pose problems as described in the following 3 errors when i'm executing the demos / examples in my putty terminal (i.e. running on embedded development board)?

                  Error 1:
                  When I tried to execute a Qt demo in my Putty terminal, it says:
                  /mnt/QtEmbedded-4.8.6-arm/examples/qws/framebuffer # ./framebuffer
                  Error: cannot open framebuffer device: Operation not permitted

                  Error 2:
                  when I tried to execute deform demo on putty terminal, it says:
                  /mnt/QtEmbedded-4.8.6-arm/demos/deform # ./deform Bus error

                  Error 3:
                  when I tried to execute books demo on putty terminal, it says:
                  ./books: error while loading shared libraries: libQtSql.so.4: cannot open shared object file: No such file or directory

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #14
                    1. You're a standard user and the /dev/fb0 access rights don't include you

                    2. I don't remember exactly but IIRC, there was a device involved e.g. error accessing the frame buffer but not related to rights.

                    3. It usually means that you don't have the Qt libraries installed on your target.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • embdevE Offline
                      embdevE Offline
                      embdev
                      wrote on last edited by
                      #15

                      Hi SGaist,
                      thanks for the note; which means I won't be able to run the Qt demos (that are residing on my HOST Ubuntu PC) on my target embedded board without the Qt lib?. I tried to point the path to the NFS in .profile file i.e.
                      PATH=/mnt/QtEmbedded-4.8.6-arm/bin
                      PATH=/mnt/QtEmbedded-4.8.6-arm/lib

                      but apparently this didn't help as I still can't run the demos.

                      For Point #1, is there a way to include access in fb0? apparently my kernel image doesn't support sudo function though, Does it mean I need to get a new kernel image with sudo function?

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #16

                        If you don't have sudo you may have su alone.

                        Well, you're building an application with Qt, so unless you make everything static, then yes, you need Qt on your target.

                        Where are you setting PATH ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • embdevE Offline
                          embdevE Offline
                          embdev
                          wrote on last edited by embdev
                          #17

                          I see. That probably explains why I can run the demos / examples on the host PC with the environment setup as my target board doesn't include Qt libraries. I'm setting my PATH in /etc/profile/ :


                          /etc/profile: system-wide .profile file for the Bourne shells

                          set_path_before()
                          {
                          [ -d $1 ] && PATH="$1:$PATH"
                          }

                          PATH="/usr/bin:/usr/sbin:/bin:/sbin"
                          set_path_before /usr/local/sbin
                          set_path_before /usr/local/bin

                          *************************************************

                          PATH to Qt lib & bin on HOST PC

                          ------------------------------

                          PATH=/mnt/QtEmbedded-4.8.6-arm/bin:$PATH
                          PATH=/mnt/QtEmbedded-4.8.6-arm/lib:$PATH

                          ************************************************

                          LD_LIBRARY_PATH="/usr/local/lib:/usr/lib"

                          export PATH


                          How about if I copy the entire Qt lib from HOST to TARGET, and then point the path to my TARGET/lib files, would that work if I run the Qt demo on the HOST (via NFS), the Qt lib now sitting on my TARGET board?

                          1 Reply Last reply
                          0
                          • embdevE Offline
                            embdevE Offline
                            embdev
                            wrote on last edited by
                            #18

                            btw, I tried to make directory Qtlib and then copy the entire Qt lib from my HOST PC into my TARGET BOARD (/Qtlib):

                            mkdir /lib/Qtlib
                            cp -r /mnt/QtEmbedded-4.8.6-arm/lib /lib/Qtlib

                            However, when I tried to change my PATH on my TARGET BOARD, i'm unable to save the file in vi editor.
                            (i.e. /etc/profile)

                            At this juncture, I tried to create a mkdir 'test' on root to test out i.e. mkdir /home/test and was returned with the following error:

                            / # mkdir /home/aa
                            mkdir: can't create directory '/home/aa': Cannot allocate memory

                            I tried to reboot embedded Linux but still unable to edit and save changes in my profile using vi editor.

                            My memory at that juncture is
                            Total = 119MB
                            Used = 35 MB
                            Free = 83 MB

                            1 Reply Last reply
                            0
                            • jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #19

                              For /etc/profile you need root access. So first call su and then start vi.

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              1
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #20

                                Linux is not Windows, PATH is only used to find executable not libraries.

                                You can use LD_LIBRARY_PATH for that.

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • embdevE Offline
                                  embdevE Offline
                                  embdev
                                  wrote on last edited by
                                  #21

                                  @jsulm it seems that my su command is not functional; when I use the command, it'll just go from my root to /~. Nonetheless, when I execute vi, I don't need root access when I type [vi profile]

                                  @SGaist Tkx, I've amended and appended LD_LIBRARY_PATH="/mnt/QtEmbedded-4.8.6-arm/lib" to my profile file in /etc/profile but i'm still having the same problem when running framebuffer - unable to find libQtGui.so.4.

                                  Could it be during cross-compilation, I could have missed out any variables when performing [Make] command?

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #22

                                    Were did you modify these variables ?

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    0
                                    • embdevE Offline
                                      embdevE Offline
                                      embdev
                                      wrote on last edited by
                                      #23

                                      I didn't modify any source code variables though, I just did a ./configure, followed by make and make install that installs Qt-everywhere-opensource-4.8.6 into my /local/Trolltech folder

                                      1 Reply Last reply
                                      0
                                      • embdevE Offline
                                        embdevE Offline
                                        embdev
                                        wrote on last edited by
                                        #24

                                        btw, i'm looking at qt-everywhere-enterprise-5.7 sources and what does it mean by 'sysroot'? Where may I locate my sysroot path?
                                        http://doc.qt.io/qt-5/embedded-linux.html

                                        jsulmJ 1 Reply Last reply
                                        0
                                        • embdevE embdev

                                          btw, i'm looking at qt-everywhere-enterprise-5.7 sources and what does it mean by 'sysroot'? Where may I locate my sysroot path?
                                          http://doc.qt.io/qt-5/embedded-linux.html

                                          jsulmJ Offline
                                          jsulmJ Offline
                                          jsulm
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #25

                                          @embdev sysroot is the file-system (or part of it) of your target device. You can mount it wherever you want (or just copy it to a location). You need the sysroot to be able to cross-compile for your target as it contains all the libs and header files.

                                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved