This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USART bytes stream rx problem on STM32f20x

Hi!
I have a problem receiving (by interrupt) more than a byte from serial port on STM32 project. could you please post an example code?

void USARTx_IRQHANDLER(void)
{ if (USART_GetITStatus(USART3, USART_IT_RXNE)) { /* Read one byte from the receive data register /*RxBuffer[RxCounter++] = (USART_ReceiveData(USART3) & 0x7F); if(RxBuffer[RxCounter] == '\r') { /* Disable the COM1 Receive interrupt USART_ITConfig(USART3, USART_IT_RXNE, DISABLE); */

t = USART3->DR; // the character from the USART1 data register is saved in t

/* check if the received character is not the LF character (used to determine end of string) * or the if the maximum string length has been been reached */

if (t != '\r') { buff[cnt] = t; cnt++; } else { // otherwise reset the character counter and print the received string cnt = 0; //USART_puts(USART3, received_string); //USART_ITConfig(USART3, USART_IT_RXNE, DISABLE); } }

what's wrong?

Parents
  • I have a problem
    no, you have two
    1) reading and following the instructions in the "Enter Message Details Below"
    2) telling WHAT the problem is. With SILabs chips, you have debugging available to state things like e.g. "the ISR does not get called"

    downloading some code or throwing it together and then posting it is not an accepted debugging method

    Erik

Reply
  • I have a problem
    no, you have two
    1) reading and following the instructions in the "Enter Message Details Below"
    2) telling WHAT the problem is. With SILabs chips, you have debugging available to state things like e.g. "the ISR does not get called"

    downloading some code or throwing it together and then posting it is not an accepted debugging method

    Erik

Children