LPUART Cannot receive data

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

LPUART Cannot receive data

跳至解决方案
2,083 次查看
DouDou1
Contributor III

I use the LPUART of S32K311 to send and receive data. It is normal to send data, but the chip cannot receive the data sent by the computer. What is the reason?Thank you.

0 项奖励
回复
1 解答
1,980 次查看
DouDou1
Contributor III
Hi,@Julián_AragónM,
Thank you for your reply. I have solved the problem, but there is something wrong with my connection. After re-connecting, we can communicate normally。

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,056 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @DouDou1,

You mention data sent by computer. Are you using any serial to USB converter? Looking at your code, it may be a timing issue regarding how you are sending messages to the S32K311.

You can look at the following UART examples for the S32K312:

They both configure the UART module, one by interrupt and another by DMA. Please test them on your side to see if this issue persists.

Best regards,
Julián

0 项奖励
回复
2,045 次查看
DouDou1
Contributor III

Hi.@Julian-AragonM,
Thank you for your reply. I used a serial to USB converter, and then modified the code according to the example you gave me, but my chip still can't receive data. Could you please help me find out what the problem is?

0 项奖励
回复
2,033 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @DouDou1,

I've modified the S32K312 UART interrupt project I've shared in the previous reply, by merging the lpuart echo example, so the MCU echoes whichever character it receives to the terminal:

2.png

Please test it on your board.

Best regards,
Julián

0 项奖励
回复
1,981 次查看
DouDou1
Contributor III
Hi,@Julián_AragónM,
Thank you for your reply. I have solved the problem, but there is something wrong with my connection. After re-connecting, we can communicate normally。
0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1956433%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELPUART%E6%97%A0%E6%B3%95%E6%8E%A5%E6%94%B6%E6%95%B0%E6%8D%AE%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1956433%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E4%BD%BF%E7%94%A8%20S32K311%20%E7%9A%84%20LPUART%20%E6%9D%A5%E5%8F%91%E9%80%81%E5%92%8C%E6%8E%A5%E6%94%B6%E6%95%B0%E6%8D%AE%E3%80%82%E5%8F%91%E9%80%81%E6%95%B0%E6%8D%AE%E6%AD%A3%E5%B8%B8%EF%BC%8C%E4%BD%86%E6%98%AF%E8%8A%AF%E7%89%87%E6%97%A0%E6%B3%95%E6%8E%A5%E6%94%B6%E7%94%B5%E8%84%91%E5%8F%91%E9%80%81%E7%9A%84%E6%95%B0%E6%8D%AE%E3%80%82%E6%98%AF%E4%BB%80%E4%B9%88%E5%8E%9F%E5%9B%A0%E5%91%A2%EF%BC%9F%E8%B0%A2%E8%B0%A2%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1961238%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ALPUART%E6%97%A0%E6%B3%95%E6%8E%A5%E6%94%B6%E6%95%B0%E6%8D%AE%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1961238%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%40Juli%C3%A1n_Arag%C3%B3nM%EF%BC%8C%3CBR%20%2F%3E%E6%84%9F%E8%B0%A2%E4%BD%A0%E7%9A%84%E5%9B%9E%E5%A4%8D%E3%80%82%E6%88%91%E5%B7%B2%E7%BB%8F%E8%A7%A3%E5%86%B3%E4%BA%86%E9%97%AE%E9%A2%98%EF%BC%8C%E4%BD%86%E6%98%AF%E6%88%91%E7%9A%84%E8%BF%9E%E6%8E%A5%E6%9C%89%E9%97%AE%E9%A2%98%E3%80%82%E9%87%8D%E6%96%B0%E8%BF%9E%E6%8E%A5%E5%90%8E%EF%BC%8C%E5%8D%B3%E5%8F%AF%E6%AD%A3%E5%B8%B8%E9%80%9A%E4%BF%A1%E3%80%82%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1957071%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9ALPUART%E6%97%A0%E6%B3%95%E6%8E%A5%E6%94%B6%E6%95%B0%E6%8D%AE%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1957071%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%E3%80%82%40Julian-AragonM%EF%BC%8C%3CBR%20%2F%3E%E6%84%9F%E8%B0%A2%E4%BD%A0%E7%9A%84%E5%9B%9E%E5%A4%8D%E3%80%82%E6%88%91%E4%BD%BF%E7%94%A8%E4%BA%86%E4%B8%B2%E5%8F%A3%E8%BD%ACUSB%E8%BD%AC%E6%8D%A2%E5%99%A8%EF%BC%8C%E7%84%B6%E5%90%8E%E6%8C%89%E7%85%A7%E4%BD%A0%E7%BB%99%E7%9A%84%E4%BE%8B%E5%AD%90%E4%BF%AE%E6%94%B9%E4%BA%86%E4%BB%A3%E7%A0%81%EF%BC%8C%E4%BD%86%E6%98%AF%E6%88%91%E7%9A%84%E8%8A%AF%E7%89%87%E4%BB%8D%E7%84%B6%E6%97%A0%E6%B3%95%E6%8E%A5%E6%94%B6%E6%95%B0%E6%8D%AE%E3%80%82%E4%BD%A0%E8%83%BD%E5%B8%AE%E6%88%91%E6%89%BE%E5%87%BA%E9%97%AE%E9%A2%98%E6%89%80%E5%9C%A8%E5%90%97%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E