AnsweredAssumed Answered

USART receive data on STM32F4

Question asked by rao.nakul on Jan 18, 2013
Latest reply on Jan 18, 2013 by rao.nakul
Hi
I am trying to receive data via USART and then put it on the LCD. I am using the following code.

void print_response(void)
{
     uint8_t i, resp[5];
     for (i=0;i<5;i++)
     {
          while (USART_GetFlagStatus(USART3, USART_FLAG_RXNE)== RESET);
                         resp[i] = USART_ReceiveData(USART3);
          USART_ClearFlag(USART1, USART_FLAG_RXNE);
     }
     sprintf((char*)buffer, "0x%x 0x%x 0x%x 0x%x 0x%x", resp[0], resp[1], resp[2], resp[3], resp[4]);
     LCD_DisplayStringLine(LINE(13), (uint8_t*)buffer);
     Delay(200);
}

As far as I can say, this code gets stuck in line 6. I am new to this and unable to get it right. Any help will be appreciated.
Thank you.

Outcomes