This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

serial port in AM437x EVM using Qt

hello,

i try to run slave serial port Qt example on my kit and i get this errors

/home/hossam/Qt/Examples/Qt-5.5/serialport/blockingslave/dialog.cpp:63: error: undefined reference to `QSerialPortInfo::availablePorts()'

/home/hossam/sitara/linux-devkit/sysroots/cortexa9t2hf-vfp-neon-linux-gnueabi/usr/include/qt5/QtCore/qlist.h:405: error: undefined reference to `QSerialPortInfo::~QSerialPortInfo()'

and so on ..........

info :

i'm using ti-processor-sdk-linux-am437x-evm-01.00.00.03-Linux-x86-Install

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
*.pro

QT += widgets
CONFIG += serialport

TARGET = blockingslave
TEMPLATE = app

HEADERS += \
    dialog.h \
    slavethread.h

SOURCES += \
    main.cpp \
    dialog.cpp \
    slavethread.cpp

target.path = /home/hossam/Qt/Examples/serial
INSTALLS += target

/////////////////////////////////////////////////////////////////////////////////

  • Hello Hossam,

    In order to get QSerialPort included to your project in Qt5 should add QT += serialport to the *.pro file.
    Where did you get the examples from? Could you point the link, so I can check it on my end.

    Best regards,
    Kemal
  • build in example in qt5 and when use QT += serialport i found error  " unknown module(s) in QT "

    you can check that link :

    doc.qt.io/.../qtserialport-blockingmaster-example.html

    thanks for reply,

    hossam adel,

  • I built the blockingmaster example with this approach.

    Follow these steps and export the Qt5 environment variables along the SDK 01.00.00.03.

    In a new terminal execute these commands:

    $ ln -s ~/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/cortexa8t2hf-vfp-neon-linux-gnueabi/usr/lib/qt5/mkspecs/linux-g++ ~/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/cortexa8t2hf-vfp-neon-linux-gnueabi/usr/lib/qt5/mkspecs/default
    $ git clone git://code.qt.io/qt/qtserialport.git
    $ cd qtserialport
    $ git checkout v5.5.0
    $ ls
    examples LGPL_EXCEPTION.txt LICENSE.FDL LICENSE.GPL LICENSE.LGPL qtserialport.pro README src sync.profile tests

    In your case am335x should be am437x.

    Open the qtserialport.pro project file with the qtcreator.

    $ source ~/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/environment-setup
    $ ./qtcreator

    Disable the shadowing.

    Add the following lines:

    target.path += /home/root
    INSTALLS += target

    to

    blockingmaster.pro

    target.path += /usr/lib
    INSTALLS += target

    to

    serialport.pro

    Set the run configuration to blockingmaster.

    Run the configuration and it you'll see the blockingmaster example running on your kit.

    Thank you!

  • Hallo Kemal,

    I have am335x and I'm working with SDK 2.0. I followed your guide to get the QT5 serial port to work. I was able to compile everything, but when I try to launch the blocking master I'll get ./blockingmaster: error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory.

    LDD:

     libQt5SerialPort.so.5 => /usr/lib/libQt5SerialPort.so.5 (0x8badf00d)
            libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x8badf00d)
            libpthread.so.0 => /lib/libpthread.so.0 (0x8badf00d)
            libc.so.6 => /lib/libc.so.6 (0x8badf00d)
            ld-linux-armhf.so.3 => /lib/ld-linux-armhf.so.3 (0x8badf00d)
            libz.so.1 => /lib/libz.so.1 (0x8badf00d)
            libicui18n.so.54 => /usr/lib/libicui18n.so.54 (0x8badf00d)
            libicuuc.so.54 => /usr/lib/libicuuc.so.54 (0x8badf00d)
            libicudata.so.54 => /usr/lib/libicudata.so.54 (0x8badf00d)
            libdl.so.2 => /lib/libdl.so.2 (0x8badf00d)
            libstdc++.so.6 => /lib/libstdc++.so.6 (0x8badf00d)
            libm.so.6 => /lib/libm.so.6 (0x8badf00d)
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x8badf00d)
            librt.so.1 => /lib/librt.so.1 (0x8badf00d)
            libudev.so.0 => /lib/libudev.so.0 (0x8badf00d)
            libQt5Widgets.so.5 => /usr/lib/libQt5Widgets.so.5 (0x8badf00d)
            libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 (0x8badf00d)
            libpng16.so.16 => /usr/lib/libpng16.so.16 (0x8badf00d)
            libGLESv2.so.2 => /usr/lib/libGLESv2.so.2 (0x8badf00d)
            libsrv_um.so => /usr/lib/libsrv_um.so (0x8badf00d)
            libIMGegl.so => /usr/lib/libIMGegl.so (0x8badf00d)
            libdrm.so.2 => /usr/lib/libdrm.so.2 (0x8badf00d)
    

    Any ideas? libudev is from Arago file system included in SDK.

    BR

    JHi

  • Does this library really exist in your target? Please check.

    root@am335x-evm:~# sync
    root@am335x-evm:~# ls -al /lib/libudev.so.0*
  • Yes it exist as you can see from the ldd output above. I copied the library from the included tisdk-rootfs to argo-base rootfs (tisdk is too big for NAND).

    Edit: under /lib libudev.so.0 -> libudev.so.0.13.1

  • You are right, the ldd command shows the library dependencies and confirms their existence. Could you attach your blockingmaster binary?

  • The binary is okay. It runs on my system. Since you are using the base rootfs you will need to port the graphics and the Qt platform eglfs plugin too. So keep in mind the final rootfs may exceed your NANDs size.

  • Yes I have everything I need. For my project I need a serial port. I'm already using Qextserialport but I wanted to change to QT5Serialport. Could you send me your libraries (libudev and libQt5Serialport) that I can test if there is a problem with my libraries or if the problem is somewhere else.

    JHi

  • Here you are!

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/blockingmaster.tar.bz2

    Place them on your target and don't forget to run ldconfig in order to recreate their bindings.

  • The problem was not my libraries. The problem was not running the ldconfig after adding libraries. Thanks for the help!

    BR
    JHi