Qt program freezing with CAN bus periodically
-
I'm trying to interface CAN bus sensor which publish around 2500 massages for a second. The application starts OK and after receiving about 20,000 messages, it starts freezing, stops debug messages and GUI and resumes periodically. I tried placing callback function to a separate thread but still the issue continues. How can I handle that volume of data with Qt ?
Any helping is really appreciated. Thanks in advance.
-
@JoeCFD I have added a incrementing counter on call back function and for about continuous 25,000 frames, data displays normally with qDebug and all the frames are detected. After that freezing starts. Also, framesAvailable value is most of the time 0 and does not exceed 10. When I send about 30,000 messages continuous with my CAN bus analyzer, it starts freezing around 26,000 and from 30,000 only around 28,800 frames are detected. It seems like it looses the frames sent during freezing period.
Processor is from NXP i.MX 8 family and it is hexa core. When freezing, one CPU core seems to reach 100%. I checked it with htop.
I detected same behavior with the "CAN Bus example" comes with Qt.
This does not seems to occur even when there is 1ms delay between frames. I tried sending 100,000 frames with 1ms delay and it detected all the frames.
-