UART data corruption at RX end

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

UART data corruption at RX end

跳至解决方案
3,253 次查看
kbhat
Contributor II

Hi All,

I'm using a MK10FX512VLQ microcontroller for development. Firmware sends data packets to a Windows PC Application through UART. At a specific data packet which is of 9 bytes that is being sent from the firmware via UART to PC app, the data is getting corrupted with the last 3 bytes being overwritten to zero. When the Firmware sends the same data packet to Docklight, the data packet is sent intact without any corruption. But when the same data packet is sent to the PC App, the PC App is receiving a corrupted data. Have tried several methods to debug this issue. But couldn't find a solution.  Please suggest solution.

Awaiting replies.

Thanks,

Krithika

标签 (1)
0 项奖励
1 解答
3,235 次查看
myke_predko
Senior Contributor III

@kbhat ,

If the data is correct when you look at it in docklight, why wouldn't you assume the problem is in your PC application?  

If I understand the flow correctly:

  1. Firmware is sending 9 byte packet
  2. PC Software is acknowledging receipt of the packet 
  3. When PC Software is processing the the 9 byte packet it becomes apparent that the last three bytes are zeros  

Is therre a checkbyte in your packet that ensures the data is correct (and generates the ack in the PC Software)?  

myke

在原帖中查看解决方案

6 回复数
3,250 次查看
bobpaddock
Senior Contributor III

Check the baud rate and frame format.
Docklight might be more forgiving about miss-matches than PC.

 

0 项奖励
3,247 次查看
kbhat
Contributor II

Hi,

The baud rate & frame format is correct. The other data packets are being received properly by the PC App and giving an ACK to firmware. But a specific data packet is getting corrupted.

0 项奖励
3,236 次查看
myke_predko
Senior Contributor III

@kbhat ,

If the data is correct when you look at it in docklight, why wouldn't you assume the problem is in your PC application?  

If I understand the flow correctly:

  1. Firmware is sending 9 byte packet
  2. PC Software is acknowledging receipt of the packet 
  3. When PC Software is processing the the 9 byte packet it becomes apparent that the last three bytes are zeros  

Is therre a checkbyte in your packet that ensures the data is correct (and generates the ack in the PC Software)?  

myke

3,204 次查看
kbhat
Contributor II

Hi Myke,

Thanks for the suggestion. The sequence of FW - PC App that you mentioned is correct. The issue was at the PC App. We added a small delay of 25ms at the serial port read method of the PC App & the issue got resolved. 

Thanks for the support.

Regards,

Krithika

3,196 次查看
myke_predko
Senior Contributor III

@kbhat 

That's great you found your problem.  

Good work!

myke

0 项奖励
3,194 次查看
kbhat
Contributor II

Thank you.

Krithika

0 项奖励