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. Read/write virtual serial port ttyRPMSG0
Qt 6.11 is out! See what's new in the release blog

Read/write virtual serial port ttyRPMSG0

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 2 Posters 2.4k 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.
  • O Offline
    O Offline
    oparmerman
    wrote on last edited by
    #1

    I'm using the STM32MP157-DK2 and have a Qt 5.11.3 application that I'd like to talk back and forth with the co-processor M4 through OpenAMP virtual serial port ttyRPMSG0.

    Initially I had success sending a message to the M4 core with this code:

        QProcess sh;
        sh.start("sh", QStringList() << "-c" << "echo 'hello virtual uart - QT'>/dev/ttyRPMSG0");
        sh.waitForFinished();
        QByteArray output = sh.readAll();
        qDebug()<< output;
        sh.close();
    

    The M4 core echo's what it receives and I can read this on a terminal session using:

    stty -onlcr -echo -F /dev/ttyRPMSG0
    cat /dev/ttyRPMSG0 &
    echo “hello virtual uart0” >/dev/ttyRPMSG0
    

    However, I'm having a problem receiving the response from the M4 core to my Qt application. I've looked into using Qserial but Qt cannot find the library (Ubuntu problem??) and compiling the library myself did not go well. But I think I should be able to get the job done using a QProcess.

    Can anyone help me receive the data from ttyRPMSG0?

    jsulmJ 1 Reply Last reply
    0
    • O oparmerman

      @jsulm I tried that but QSerialPort is not found. I've spent the better part of a day trying to add QSerialPort to my Qt install but nothing works. First I tried:

      sudo apt-get install libqt5serialport5
      sudo apt-get install libqt5serialport5-dev
      

      But Qt still doesn't know about QSerial. Here's a few links I've tried and the result:

      Trouble with QSerialPort with qtcreator on Debian which led me to try building the QSerialPort library. But trying to make the QSerialPort library results in:

      fatal error: private/qiodevice_p.h: No such file or directory
      

      Which led to this link which fixed the issue with:

      sudo apt-get install qtbase5-private-dev
      
      

      But then I still get errors in compilation.

      I am using Buildroot to make the target Linux image. Could the Qt packages selected for Buildroot make a difference in the libraries that Qt Creator knows about?

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

      @oparmerman said in Read/write virtual serial port ttyRPMSG0:

      I am using Buildroot to make the target Linux image. Could the Qt packages selected for Buildroot make a difference in the libraries that Qt Creator knows about?

      You need to install Qt serial port stuff in your Buildroot/sysroot

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

      O 1 Reply Last reply
      3
      • O oparmerman

        I'm using the STM32MP157-DK2 and have a Qt 5.11.3 application that I'd like to talk back and forth with the co-processor M4 through OpenAMP virtual serial port ttyRPMSG0.

        Initially I had success sending a message to the M4 core with this code:

            QProcess sh;
            sh.start("sh", QStringList() << "-c" << "echo 'hello virtual uart - QT'>/dev/ttyRPMSG0");
            sh.waitForFinished();
            QByteArray output = sh.readAll();
            qDebug()<< output;
            sh.close();
        

        The M4 core echo's what it receives and I can read this on a terminal session using:

        stty -onlcr -echo -F /dev/ttyRPMSG0
        cat /dev/ttyRPMSG0 &
        echo “hello virtual uart0” >/dev/ttyRPMSG0
        

        However, I'm having a problem receiving the response from the M4 core to my Qt application. I've looked into using Qserial but Qt cannot find the library (Ubuntu problem??) and compiling the library myself did not go well. But I think I should be able to get the job done using a QProcess.

        Can anyone help me receive the data from ttyRPMSG0?

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

        @oparmerman Why don't you use https://doc.qt.io/qt-5/qserialport.html ?

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

        O 1 Reply Last reply
        2
        • jsulmJ jsulm

          @oparmerman Why don't you use https://doc.qt.io/qt-5/qserialport.html ?

          O Offline
          O Offline
          oparmerman
          wrote on last edited by
          #3

          @jsulm I tried that but QSerialPort is not found. I've spent the better part of a day trying to add QSerialPort to my Qt install but nothing works. First I tried:

          sudo apt-get install libqt5serialport5
          sudo apt-get install libqt5serialport5-dev
          

          But Qt still doesn't know about QSerial. Here's a few links I've tried and the result:

          Trouble with QSerialPort with qtcreator on Debian which led me to try building the QSerialPort library. But trying to make the QSerialPort library results in:

          fatal error: private/qiodevice_p.h: No such file or directory
          

          Which led to this link which fixed the issue with:

          sudo apt-get install qtbase5-private-dev
          
          

          But then I still get errors in compilation.

          I am using Buildroot to make the target Linux image. Could the Qt packages selected for Buildroot make a difference in the libraries that Qt Creator knows about?

          jsulmJ 1 Reply Last reply
          0
          • O oparmerman

            @jsulm I tried that but QSerialPort is not found. I've spent the better part of a day trying to add QSerialPort to my Qt install but nothing works. First I tried:

            sudo apt-get install libqt5serialport5
            sudo apt-get install libqt5serialport5-dev
            

            But Qt still doesn't know about QSerial. Here's a few links I've tried and the result:

            Trouble with QSerialPort with qtcreator on Debian which led me to try building the QSerialPort library. But trying to make the QSerialPort library results in:

            fatal error: private/qiodevice_p.h: No such file or directory
            

            Which led to this link which fixed the issue with:

            sudo apt-get install qtbase5-private-dev
            
            

            But then I still get errors in compilation.

            I am using Buildroot to make the target Linux image. Could the Qt packages selected for Buildroot make a difference in the libraries that Qt Creator knows about?

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

            @oparmerman said in Read/write virtual serial port ttyRPMSG0:

            I am using Buildroot to make the target Linux image. Could the Qt packages selected for Buildroot make a difference in the libraries that Qt Creator knows about?

            You need to install Qt serial port stuff in your Buildroot/sysroot

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

            O 1 Reply Last reply
            3
            • jsulmJ jsulm

              @oparmerman said in Read/write virtual serial port ttyRPMSG0:

              I am using Buildroot to make the target Linux image. Could the Qt packages selected for Buildroot make a difference in the libraries that Qt Creator knows about?

              You need to install Qt serial port stuff in your Buildroot/sysroot

              O Offline
              O Offline
              oparmerman
              wrote on last edited by
              #5

              @jsulm This was the solution. Thank you.

              1 Reply Last reply
              1

              • Login

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