2025-10-08 12:59 AM - last edited on 2025-10-08 1:08 AM by Andrew Neil
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,
Solved! Go to Solution.
2025-10-08 2:03 AM
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?
2025-10-08 1:05 AM
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?
2025-10-08 1:16 AM
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.
2025-10-08 1:37 AM
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.
2025-10-08 1:52 AM
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.
2025-10-08 2:03 AM
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?
2025-10-08 2:30 AM
@kickerkro wrote:1 bit is 8.6us which is what supposed to be for the 115200.
should be nearer 8.7 (8.681)
8.6 gives 116279
2025-10-08 2:46 AM
I tried with a 32MHz crystal oscillator and it worked. Thanks for the help