Hi NXP Team,
I am working with an NXP S32K312 MCU and using the LPUART peripheral. The required UART baud rate for the communication is 1 Mbps.
The LPUART 6 functional clock is 30 MHz.
I initially configured the UART with:
With this configuration, I observed a framing error during communication.
I understand that with the LPUART baud rate calculation:
Baud Rate = LPUART Clock divided by SBR multiplied by OSR
I also tried a configuration intended to achieve exactly 1 Mbps:
However, I am still observing a framing error.
I also tried 921600 baud, but I observed a framing error at this baud rate as well.
Could you please help clarify:
I can provide the LPUART BAUD register value, RTD configuration, and logic analyzer capture if required.
Please advise on the recommended configuration and any additional debugging steps.
Thanks.
Hello @gayathri123 ,
Could you please confirm whether the error is reported in LPUART6_STAT[FE], by the BQ79600 or only by the logic analyzer?
The 2.75 ms LOW wake-up pulse is much longer than a UART frame. If the LOW level is also present on the S32K312 RX input while the receiver remains enabled, the LPUART may correctly report a framing error because no valid stop bit is detected. The flag may therefore originate from the wake-up phase and remain set when normal UART communication starts.
As a test, please:
Please provide a logic-analyzer capture of both TX and RX, together with the LPUART6_STAT value before and after the wake-up pulse. It is particularly important to identify the exact moment when STAT[FE] becomes set.
Best regards,
Pavel
Hi
We are using an S32K312 with LPUART6 configured at 1 Mbps. PTD9 is configured as the LPUART6 TX pin.
We are observing a framing error during UART communication when we temporarily configure PTD9 as GPIO and then remux it back to LPUART6 TX.
The sequence is as follows:
Hello @gayathri123 ,
Thank you for the detailed description.
The first point to clarify is the LPUART baud-rate formula. For the S32K3 LPUART, the effective baud rate is calculated as:
Therefore, if the BAUD register contains SBR = 2 and OSR = 15, the resulting baud rate is:
It is therefore not 1 Mbps. This deviation is large enough to cause a framing error when the communication partner operates at 1 Mbps.
For a 30 MHz LPUART functional clock, an exact 1 Mbps baud rate can be obtained with:
Please note that some configuration tools may display the effective oversampling ratio, while the BAUD register stores this value minus one. For this reason, please read back the complete LPUART6_BAUD register after initialization and verify the actual OSR and SBR fields.
The S32K312 LPUART can support 1 Mbps communication. A 30 MHz functional clock is also suitable because it allows the baud rate to be generated exactly. No special additional configuration should normally be required beyond the correct clock, baud-rate settings, frame format, pin configuration and receiver configuration.
Best regards,
Pavel