2021-05-13 05:22 PM
Hello,
I am experiencing some problems when trying to receive data from PC using UART and then check if it is correct. I am using using LL API and this code is placed in while(1) of main function. For example, when I send 'A' from PC to STM32, PC receives response with '0x01' but if I try to send 'A' again, it does not respond anymore. Do I have to clear some flags of USART before receiving again?
Thank you
2021-05-13 06:14 PM
Need to wait of TXE for the transmit, and RXNE on the receive
LL_USART_IsActiveFlag_TXE(USART2)
2021-05-15 04:29 AM
I noticed that LL_USART_TransmitData8 function successfully transmits chosen value every time when data = 'A' is received:
But now I want to transmit a string:
TransmitString function:
And the problem is that string is transmtited only one time when first time data = 'A' is received. When data = 'A' is received again, nothing is transmitted. Could you help me to solve this problem?
2021-05-15 06:22 PM
I found out that when I transmit only one symbol, for example '9' or 'C' then data recption is not blocked. But if I transmit more than one symbol, for example '10' or 'CC', then data reception is blocked. Could you help me to solve this problem?
2021-05-17 01:48 PM
The problem is that when more than one symbol (digit or letter) is sent from PC to STM32 over UART , then STM32 received value (in my case called data) becomes '13' and it does not change anymore no matter how many times I send any values from PC to STM32 again.
2021-05-17 10:24 PM
2021-05-18 06:12 AM
I use STM32L011. I will try to check if this code of overrun error correction helps. Thank you.
2021-05-18 05:30 PM
How should I use this function?
It blocks receiving data if I start it in while, before data=LL_USART_ReceiveData8(USART2).