Uart data corrupt if working with Qt Qml on Allwinner A20 legacy kernel
-
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. -
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 ? -
How are you setting up the QSerialPort you are using for your application ?
-
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.
-
@SGaist
baud is correct, i can see it with logic analyzer
i have made new class inherit from QSerialPort and thenQThread *serialThread = new QThread(); mySerialClass = new MySerialClass(); mySerialClass->moveToThread(serialThread); serialThread->start(); serialThread->setPriority(QThread::TimeCriticalPriority);
-
I didn't imply that the value was wrong, setBaudRate returns a boolean, that's the return value I suggested to check.
-
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 :)