Skip to main content
Jay_Bolboli
Associate II
Mar 13, 2023 8:53 AM UTC
Question

Hello everyone, I am encountering an issue with UART1 while using STM32WL for LoRa Communication with SubGHz_Phy_Per and STM32WL-SubGHz-PhyBasic-Tx-Rx examples from the STM32 Github.

In my application, I receive a message from LoRa and intend to transmit it via UART1 which is set to PA9 and PA10. However, when I check the UART RX using a logic analyzer, I do not receive anything.

I have tested the UART1 alone in a simple project, and it works fine. But, when I integrate UART1 into the SubGHz_Phy_Per and STM32WL-SubGHz-PhyBasic-Tx-Rx examples, it does not work.

I have added HAL-UART to the OnTxDone function, main function, and other parts of the code, but the issue persists. Can someone please suggest a solution to this problem?

#[UART/USART]​ #LoRa​ #STM32WL​ 

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
Mar 13, 2023 9:28 AM UTC

The solution would be to debug the problem, looking at peripheral and clock settings. Be sure to clear any errors and status, like noise or framing errors.

I would not put any blocking code in the call backs, but rather use buffering.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Jay_Bolboli
Associate II
Mar 14, 2023 1:16 AM UTC

Dear Tesla DeLorean,

Thank you for your previous response. I followed your recommendations, checked the peripheral and clock settings, and cleared any errors, but the issue persists.

Interestingly, I found that when I am in debug mode, the UART1 works fine, but when I'm not in debug mode, it doesn't work as expected.

I appreciate any additional insights or suggestions you may have.

Jay_Bolboli
Associate II
Mar 15, 2023 1:30 AM UTC

Update on the problem:

I have successfully solved the issue with the STM32WL-SubGHz-PhyBasic-Tx-Rx examples by noticing that the UART1 clock was not active while i activated it. After importing the project again, the project worked properly.

However, the issue still persists with the SubGHz_Phy_Per example. Interestingly, I found that the UART1 works fine when I am in debug mode, but not when I'm not in debug mode. I even added some hal-delay to check if the problem was due to timing, but there was no change.