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
Forum Updated to NodeBB v4.3 + New Features

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 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.
  • A Offline
    A Offline
    AneoX
    wrote on 13 Jan 2017, 19:13 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 13 Jan 2017, 21:41 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 14 Jan 2017, 09:33
      0
      • A Offline
        A Offline
        AneoX
        wrote on 14 Jan 2017, 09:15 last edited by AneoX
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • S SGaist
          13 Jan 2017, 21:41

          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 14 Jan 2017, 09:33 last edited by AneoX
          #4

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

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 14 Jan 2017, 16:09 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 14 Jan 2017, 16:22
            0
            • S SGaist
              14 Jan 2017, 16:09

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

              A Offline
              A Offline
              AneoX
              wrote on 14 Jan 2017, 16:22 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
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 14 Jan 2017, 20:57 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 15 Jan 2017, 08:20
                0
                • S SGaist
                  14 Jan 2017, 20:57

                  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 15 Jan 2017, 08:20 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
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 15 Jan 2017, 21:39 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 16 Jan 2017, 10:20
                    0
                    • S SGaist
                      15 Jan 2017, 21:39

                      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 16 Jan 2017, 10:20 last edited by AneoX
                      #10

                      only solution is decrease baud rate

                      1 Reply Last reply
                      2
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 16 Jan 2017, 14:57 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

                        1/11

                        13 Jan 2017, 19:13

                        • Login

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