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 3.0k 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 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