Question
USART Loopback with STM32F107
Posted on May 20, 2015 at 11:35
Hi,
I would make a loopback with my board STM3210C using USART2. I use the code/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Recieve%20more%20then%201%20Byte%20over%20USART&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=3862
. Here is my main code :while(1)
{
//Wait until a byte is received
while(USART_GetFlagStatus(USART2, USART_FLAG_RXNE) == RESET);
RXBUFF[j] = USART_ReceiveData(USART2);
if (USART_GetFlagStatus(USART2, USART_FLAG_TXE) != RESET)
USART_SendData(USART2, RXBUFF[j]);
j++;
if (j >= 1)
j = 0;
}
When I use the Hyperterminal to show the data exchange, I have a value returned only all the 4 or 5 values send.
I just would send a number between 0 and 9, and receveid the same to verify the connexion.
Thanks for your help
Best regards
Loïc