2023-03-13 01:53 AM
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
2023-03-13 02:28 AM
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.
2023-03-13 06:16 PM
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.
2023-03-14 06:30 PM
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.