2025-08-06 7:34 AM
Hello everyone,
I'm using STM32WLE5 (LoRa E5) module for sending the data from one module to the other. The Lora transmitter will be receiving the data from the UART1 which is then transmitted over the radio.
I have used baudrate 115200 and tested, everything works fine. But when I change the baudrate from 115200 to the higher baudrate(921600), No data is being received by the STM32WLE5 module. Clock of the peripheral is running with 48MHz. Is there any configuration of UART that need to be changed for the uart baudrate to work properly?
2025-08-06 8:10 AM
What is sending the data?
Are you sure that it works properly at such a high baud rate?
Such a high baud rate seems a bit pointless with LoRa - which tends to be a very slow link ...
2025-08-06 8:32 AM
Breakdown the problem..
Is the UART indicating status or errors? Say framing or overrun? Are you clearing those?
Are you using DMA and sufficiently deep buffers?
What's the "Air Rate"? Is it adequate?
Diagram what you're doing, and the point at which it's failing
Use a baud rate that's a cleaner multiple of the primary clock. Check if 800 Kbps or 1 Mbps work more reliably.
Radio can be hard, prepare to do some debugging.
2025-08-06 9:27 AM - edited 2025-08-06 9:46 AM
Hello @Tesla DeLorean, @Andrew Neil,
I want to send the data from the RTK GPS data from the GPS connected to STM32WLE5 module to the other. RTK GPS sends the data of max 1200bytes for every second. But it divides the data into 2 to 3 chunks.
Setup:
Tx Side:
RTK GPS data ----> UART1 ------> STM32WLE5 TX ----> Radio Transmission
Rx Side:
Radio Receive ------> STM32WLE5 RX --------> UART1 ---------> Target
Procedure:
I'm using LL driver with interrupts for receiving the data in the STM32WLE5 TX by enabling (LL_USART_EnableIT_RXNE() and LL_USART_EnableIT_ERROR()). With the interrupts, I'm filling the ring buffer which is then send through the radio in While loop with the maximum size of 255 waiting for the airtime to be completed using OnRadioSent() interrupt. If error interrupt received, I'm clearing them.
With 115200, I sometimes receive the Overrun error interrupts which is because of data being received in the time of using Radio.Send() in which interrupts are being disabled. I checked the data from the RTK GPS for higher baud rate. Then I can get all the data at the same time which can prevent the overrun errors. Is there any other approach for not getting overrun errors?
I'm not using DMA for this. Will it help in this case?
The air time for 255 bytes to be sent is around 109ms.
Please give me the better approach to get the data transferred to the target without Overrun Errors at Tx Side.
2025-08-06 10:19 AM
So probably RTCM3 packets, a position, and one for each constellation.
You're buffering needs to be large enough and robust enough to capture all the packets/data, regardless of you being in the middle of a Radio.Send() operation. You'll have to decompose the larger RTCM3 packets across multiple smaller LoRa packets <255 bytes. I'd probably pick a strategy that breaks on RTCM3 packet boundaries, and then splits them into 2 or 3 LoRa packets of smaller and equal size.
You can manage the UART via IRQs, DMA can be used, but adds complexity.
Not sure there's a net benefit to going at 921600 baud when the LoRa rate is probably closer to 10-25 kbps, so get the buffering figured out, so it works in the background, and you can dispatch data in the foreground LoRa loop.
The uBlox receivers can take whatever baud rate settings you want, so 200 Kbaud or 400 Kbaud can be workable too.