2136196_en-US

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

2136196_en-US

2136196_en-US

s32k312 uart

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

Re: s32k312 uart

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
Re: s32k312 uart

"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?"

Re: s32k312 uart

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


Tags (1)
No ratings
Version history
Last update:
‎11-21-2025 06:26 PM
Updated by: