J17 ttyTHS2 receive MEMS data has a problem

I have a Mems.When i use Windows10 can receive the right data like this.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

A5 00 07 81 FF FE 1D FF F1 CB 00 FF ED A0 00 0A E1 02 00 74 00 1C 47 1E 3D 1C 22 00 1C 22 1E 3D 1C 47 00 CD 03 F9 00 00 0D B0
A5 00 04 8C FF FC 26 FF F9 90 00 FF ED 9D 00 0B E3 01 FF 7C 00 1C 22 1E 24 1C 15 00 1C 15 1E 24 1C 22 00 CE 03 F9 00 00 0D FD
A5 FF FC C3 00 02 EB 00 06 31 00 FF EE 57 00 0B EA 01 FF 38 00 1C 3B 1D F1 1C 3B 00 1C 3B 1D F1 1C 3B 00 CF 03 F9 00 00 0E 3B
A5 FF F9 D8 00 06 D2 00 02 4C 00 FF EF 96 00 0B A7 01 FF B5 00 1C 47 1E 17 1C 54 00 1C 54 1E 17 1C 47 00 D0 03 F9 00 00 0D 62
A5 FF FB CD 00 02 DE FF F4 AE 00 FF F1 98 00 0C 2A 01 FF B7 00 1C 3B 1E 17 1C 3B 00 1C 3B 1E 17 1C 3B 00 D1 03 F9 00 00 0E F5

it’s 42 datas.but when i use the TX1 receive the data.it’s like that.the number of datas are wrong.like this.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
a5 ff ff a7 80 81 79 40 a0 04 04 a4 e4 fa ea d8 01 fe e1 80 8e 45 47 7c 23 33 a0 23 73 14 1c 15 00 27 83 fd 80 80 87 e6 00 00 00 00 00
a5 ff fe b2 ff fe e8 fe 38 00 00 88 ba ea 98 01 ff e1 80 8e 45 47 79 23 2e a0 23 6e 54 1c 15 00 28 83 fd 80 80 00 88 eb 00 00 00 00
a5 ff fe b3 ff fd 8c fc 52 00 00 88 f8 ec 99 02 00 e1 80 8e 45 47 79 23 33 a0 23 b3 54 1c 15 00 29 83 7e 40 40 44 e0 00 00 00 00
a5 ff fb bc ff 7f a1 fd 42 00 00 89 b6 ec 57 02 01 ab 80 a3 3c a4 b4 b4 06 f4 5a f3 52 da 1a 00 2a 03 f9 80 80 48 fc 00 00 00 00
a5 00 03 8d ff fe 4c 40 90 08 08 08 c8 ed ec 53 02 00 e1 80 8e 45 74 b4 14 03 da 8a f3 ba 72 55 01 ad 0d e5 00 00 0a d8 00 00
a5 00 08 67 ff fe 46 40 40 02 02 4a 3a fa ec d8 01 ff e7 80 23 1d e5 1b bd 80 8d 6f 47 79 23 00 2c 03 f9 00 0f 0e 00 00 00 00 00 00
a5 00 06 7e ff ff bf f5 9e 00 00 89 ef eb 98 01 fe df 80 8e 91 47 79 23 3e a0 23 7e 54
1c 22 00 2d 83 fd 80 80 44 ef 00 00 00 00 00
a5 ff fc ac 80 82 b9 fc 4e 00 00 8a 94 e9 da 01 fd de 80 23 b9 84 b7 14 03 da 8a eb 42 1b ca 00 2e 83 fd 80 80 44 ef 00 00 00 00
a5 ff fa c0 80 83 e0 80 41 3f 20 20 a1 e9 e9 da 01 fe a5 80 23 1d d8 1b 98 80 8d cc 47 76 23 00 2f 03 f9 00 0f eb 00 00 00 00 00
I use many Serial debugging assistants,they are all wrong.I’m sure i set it wright.Can you help me to solve the problem.

Thanks.

Is the cabling any different for your use with Jetson versus Windows? Do both use the same flow control settings? Are you using the default 115200 8N1 settings? Is the camera installed on the Jetson?

Yes,i use the same flow control settings,and i set 921600 8n1.Should i take off the camera ?

J17 (ttyTHS2) is wired to the camera module as well. If the camera doesn’t do anything it won’t matter…but it is possible the camera is interacting. I would remove it (just remove the screws and it can be disconnected) for testing. If that doesn’t help, then more debugging can be done.

I remove the camera,but it doesn’t work,I also got the wrong data.Then i try to use j21,and delete the “control=”, it also got the wrong data.I use windows to recieve Mems data,and use windows to send that data to the TX1(i want to use windows to disguise the Mems).Data is wright.Then i think the windows maybe not a real-time system,so i change another Mems(it is a ARM).And i change the transmission rate(100ms,500ms,1000ms).They’re all wrong.The data also more than send.The strange thing is, I could always get the frame header.The header data:A5 or 55 they never wrong.

Thank you for your patience.

J21 can’t be used unless you disable serial console. If you connect to J21 after boot (and if the kernel command line in extlinux.conf doesn’t say to use serial console), then this is somewhat simple. If you need to disable in U-Boot it gets more complicated.

For ttyTHS2 does some of the data still come through uncorrupted…and does disconnecting the camera make any difference at all? When using ttyTHS2 are you using CTS/RTS flow control (if running faster it is possible to overflow the buffer…you probably want hardware flow control as speeds increase)?

I took off the camera there is no difference.
For ttyTHS2 ,i didn’t using CTS/RTS flow control.

Can you try with CTS/RTS flow control? Without this you might be running into a buffer overflow (the UARTs have a tiny buffer…maybe 16 bytes? not sure). The faster you go or the longer CPU0 is working on some other hardware driver the greater the chance this occurs.

I reduce Baud rate to 576000 or more lower.It can works wright.460800 can meet my needs!

Thank you for your patience.
Thanks a lot!