Skip to main content
Associate II
October 8, 2025
Solved

STM32WB55 LPUART Baud Rate Issue

  • October 8, 2025
  • 3 replies
  • 441 views

 

Hello STM Community,

I’ve been struggling with an issue for some time and would appreciate your insights.

I’m using an STM32WB55 MCU connected to an LTE modem via LPUART for cellular communication. The modem’s default baud rate is 115200.

I use a ring buffer with interrupt-based reception:

 

 
HAL_UART_Receive_IT(&huart1, rxByte, 1);

At 115200 baud, I can see valid TX/RX activity on the lines using a logic analyzer, but the MCU does not receive or process any data in my ring buffer.

However, when I lower the baud rate to 9600, everything works perfectly — I can read and process all incoming data as expected. The only change I make is the baud rate; the hardware and code remain the same.

Has anyone encountered similar behavior with LPUART on the STM32WB55. I’d like to maintain 115200 baud for my application’s performance requirements. Does anyone have an idea how should I proceed on with this?

Best regards,

Best answer by Andrew Neil

RC oscillators are not recommended for UART clock sources - they typically don't have the necessary accuracy.

This is often seen as "working OK" at low speeds (eg, 9600), but not at higher speeds (eg, 115200).

Have you tried using a crystal-based source?

 

#RCOscillator #UartRCOscillator #BaudRateError #InaccurateBaudRate

3 replies

Andrew Neil
Super User
October 8, 2025

Before adding the complications of  an LTE modem, have you tested your code against a serial terminal on a PC?

Have you used an oscilloscope or Logic Analyser to see what baud rate your STM32 is actually running at?

What clock source are you using?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
kickerkroAuthor
Associate II
October 8, 2025

Hi Andrew,

I have tested my setup with a serial terminal as well. As I mentioned in my text, I can see that the data can be observed in the TX and RX line of the the UART between the mcu and a modem. Therefore, I am certain that I can write to the UART TX line with 115200 and modem responds with this speed in UART RX line. My clock source is PLCK1 and it is 4Mhz.

Andrew Neil
Super User
October 8, 2025

But have you measured the actual speed on the line?

What is the source of the PCLK1? Have you verified that?

 

For example, see this thread - it turned out that the source clock frequency was not (quite) what was expected.

Similarly here.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
kickerkroAuthor
Associate II
October 8, 2025

Yes, I measured it. 1 bit is 8.6us which is what supposed to be for the 115200. The PLCK1 is derived from the SYSCLK and it is 4MHz. It uses MSI RC. 

Andrew Neil
Andrew NeilBest answer
Super User
October 8, 2025

RC oscillators are not recommended for UART clock sources - they typically don't have the necessary accuracy.

This is often seen as "working OK" at low speeds (eg, 9600), but not at higher speeds (eg, 115200).

Have you tried using a crystal-based source?

 

#RCOscillator #UartRCOscillator #BaudRateError #InaccurateBaudRate

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
kickerkroAuthor
Associate II
October 8, 2025

I tried with a 32MHz crystal oscillator and it worked. Thanks for the help