s32k312 uart

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

s32k312 uart

1,092 Views
fengba_360
Contributor III

Hello, when using UART communication on the S32K312, if the baud rate exceeds 19200, the received data has a high error rate or even fails entirely. At baud rates below 19200, there are no issues. What could be causing this, and how can I optimize it? Below are my receive code and clock configuration?微信图片_20250718111859.png微信图片_20250718111744.png

0 Kudos
Reply
3 Replies

1,062 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

most probably it will be due to callback processing. Remove below code and rely just on callback events.

PetrS_0-1752830107838.png

Try to keep RXFULL event as short as possible as this is called for each byte received if Receive function was called with 1 byte to be received.

BR, Petr

 

0 Kudos
Reply

916 Views
fengba_360
Contributor III

"This is not the issue. If I increase the baud rate, the serial bus seems to crash, and the MCU stops receiving data. If I enable error recovery, there are instant data errors but it doesn't stop receiving. Have you encountered this problem before?"

0 Kudos
Reply

901 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the code is redundant, but can be useful to restore reception.
You should rather use Events directly, like below
PetrS_2-1753181872126.png

The received byte processing code should be as short as possible, to have short execution time. This callback event must be called for each byte received. Otherwise you will get overruns etc.

So consider interrupt priority with respect of other tasks/peripherals of your application. 
 
BR, Petr
0 Kudos
Reply