Good afternoon, my name is Gabriel, I work at MWF-Dynamics.
I am involved in a project where we are using the Apalis iMX8 module and an Apalis Evaluation Board. The Linux version we are using is the one generated in yocto, based on this article:
The scenario is as follows: We have a device that sends a 54-byte message periodically over the serial and we want to receive, process and extract the measurements from that message.
To handle this data, a simple c++ program was created that configures and watches the iMX8 serial waiting for the data that is sent by the device. As soon as the device sends the 54-byte message, the program processes and returns the measurements.
This device in question supports various baudrates and the frequency of sending messages is also configured on it.
For transmission frequencies less than 100hz → baudrate: 115200
For transmission frequencies between 100hz and 200hz → baudrate: 230400
For transmission frequencies between 200hz and 400hz → baudrate: 460800
Our problem here is not being able to receive the message correctly on the iMX8 when the sending frequency of the device exceeds 50hz. For frequencies higher than 50hz it seems that the iMX8 allocates the messages and delivers me in a much longer period than the message actually arrived for it causing me to always receive the late measurements.
An interesting piece of information is that the device in question also has an integrated USB-Serial converter, and using the virtual serial port generated by the device when connected via USB, my program normally receives the 54 bytes for all configurable send frequencies on the device ( 1 - 400hz).
That is, the same c++ program that keeps looking at the iMX8’s physical serial, when configured to look at the virtual serial, works correctly. After this test I “discarded” the possibility of being a processor or code bottleneck.
I put the device on the oscilloscope to confirm that it is sending the message with the correct length and period and it really is!
Another test done by me was to configure a second serial port to send a message of 54 bytes periodically to another serial port and again for frequencies higher than 50 hz the reception of the message is lost.
I would like to know if anyone has any information about any limitation in the frequency of reception of the physical serial of the iMX8 or if you have experienced a similar problem.
Thank you in advance for your attention and apologize for the length of the text. I decided to list here the complete scenario and the main tests I ran to better describe the problem.