S32K312 LPUART Registers Issues

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K312 LPUART Registers Issues

ソリューションへジャンプ
418件の閲覧回数
JayJay_H
Contributor III

Hi

I recently encountered an issue while using LPUART as a serial port and connecting it to a computer through a serial cable. I was using the computer's serial software for input , and found that:

In case of power off, plug in the serial TX and RX cables and then power on, At this time, the input and output can be normal without any problems.

But after powering on, unplug and then insert the RX cable, the FE bit of STAT will remain in an abnormal state. Since I cannot determine when the user will unplug and reinsert the serial port cable in actual situations, I do not have a good time to reset the FE bit. However, when initializing the CTRL register, I turned off the FEIE interrupt, so even if there is an abnormality in the FE bit of STAT, it will not generate an interrupt, which has little impact on my program

I wrote a test code, let the board cycle output data to the serial port, and found that when the TX cable was unplugged and plugged in, the STAT status was normal, After unplugging and plugging in the TX cable, the data could be output normally, but when the RX cable was unplugged and plugged in again, the FE was abnormal. Therefore, my problem is as follows:

1. What specific error does the Framing Error corresponding to the FE bit refer to? Can you give an example of any other situations that can be triggered?

2. Taking on the first question, what impact will it have on the LPUART driver if I keep not clearing the FE bit?

Looking forward to your reply

Thanks

ラベル(1)
タグ(3)
0 件の賞賛
1 解決策
399件の閲覧回数
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @JayJay_H

Recommendations are to avoid connecting/disconnecting wires while operating and to clear the FE flag.

1. The Framing Error is reported when the received char has 0 where a stop bit should be:

Julin_AragnM_0-1705341610415.png

This flag is triggered because the UART instance is still waiting on the stop bit for the transmission. This can also be caused by clock skew, if the transmitter clock and receiver clock are not derived from the same source, then one will run faster than the other. 

2. When receiving UART data (or serial data in general) it is recommended to always check for errors and clear the flag (+ deal with the error) first. This will not necessarily affect transmissions, but it should be checked and cleared, as functionality is not guaranteed.

Best regards,
Julián

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
400件の閲覧回数
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @JayJay_H

Recommendations are to avoid connecting/disconnecting wires while operating and to clear the FE flag.

1. The Framing Error is reported when the received char has 0 where a stop bit should be:

Julin_AragnM_0-1705341610415.png

This flag is triggered because the UART instance is still waiting on the stop bit for the transmission. This can also be caused by clock skew, if the transmitter clock and receiver clock are not derived from the same source, then one will run faster than the other. 

2. When receiving UART data (or serial data in general) it is recommended to always check for errors and clear the flag (+ deal with the error) first. This will not necessarily affect transmissions, but it should be checked and cleared, as functionality is not guaranteed.

Best regards,
Julián

0 件の賞賛
387件の閲覧回数
JayJay_H
Contributor III

Hi @Julián_AragónM 
Thank you for your support.
Best Regards.

Joshua