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. Uart data corrupt if working with Qt Qml on Allwinner A20 legacy kernel
QtWS25 Last Chance

Uart data corrupt if working with Qt Qml on Allwinner A20 legacy kernel

Scheduled Pinned Locked Moved Solved Mobile and Embedded
11 Posts 2 Posters 2.9k Views
  • 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.
  • A Offline
    A Offline
    AneoX
    wrote on last edited by AneoX
    #1

    I am working with embed device with Allwinner A20 cortex-a7 cpu.
    Qt was build with mali support, to work direct with framebuffer like here, no x11
    My app are using uart to recieve data.

    If i run own app and (for example) standart Qml Oscilliscope from Qt 5.7 examples simultaneously, data bytes recieved from uart lost or become wrong in my app. I have test with QSerialPort and basic C serial implemintation in my app(like here), same result.
    Htop return system load under 0.75(A20 has 2 cores), so looks like a system not fully load.

    If i run my app and sysbench --test=cpu --cpu-max-prime=20000 --num-threads=2 run, htop return 100% load on both cores, but my app not lost any data.

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

      Hi and welcome to devnet,

      Did you check that you are setting up your serial port correctly ?
      How do you know whether you got all data ?

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

      A 1 Reply Last reply
      0
      • A Offline
        A Offline
        AneoX
        wrote on last edited by AneoX
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi and welcome to devnet,

          Did you check that you are setting up your serial port correctly ?
          How do you know whether you got all data ?

          A Offline
          A Offline
          AneoX
          wrote on last edited by AneoX
          #4

          @SGaist
          Hi!
          I am sending 96 bytes packet with CRC every 155ms, data corrupt

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

            How are you setting up the QSerialPort you are using for your application ?

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

            A 1 Reply Last reply
            0
            • SGaistS SGaist

              How are you setting up the QSerialPort you are using for your application ?

              A Offline
              A Offline
              AneoX
              wrote on last edited by
              #6

              @SGaist

              setPortName("/dev/ttyS1");
              setBaudRate(1500000);
              setDataBits(8);
              setParity(0);
              setStopBits(1);
              setFlowControl(0);
              
              if (open(QIODevice::ReadWrite))
              {
              

              ..............

              it working well, if run alone

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

                You should also check that setBaudRate is successful.

                Then are you using in your port in the main thread ? If so, you should move its handling in its own thread.

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

                A 1 Reply Last reply
                0
                • SGaistS SGaist

                  You should also check that setBaudRate is successful.

                  Then are you using in your port in the main thread ? If so, you should move its handling in its own thread.

                  A Offline
                  A Offline
                  AneoX
                  wrote on last edited by
                  #8

                  @SGaist
                  baud is correct, i can see it with logic analyzer
                  i have made new class inherit from QSerialPort and then

                  QThread *serialThread = new QThread();
                  mySerialClass = new MySerialClass();
                  mySerialClass->moveToThread(serialThread);
                  serialThread->start();
                  serialThread->setPriority(QThread::TimeCriticalPriority);
                  
                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    I didn't imply that the value was wrong, setBaudRate returns a boolean, that's the return value I suggested to check.

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

                    A 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      I didn't imply that the value was wrong, setBaudRate returns a boolean, that's the return value I suggested to check.

                      A Offline
                      A Offline
                      AneoX
                      wrote on last edited by AneoX
                      #10

                      only solution is decrease baud rate

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

                        Nice !

                        In that case, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

                        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

                        • Login

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