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

Error "USART_IT_RXNE"

My application receive data in usart1 through interrupt.
I generated the files in STM32CubeMX for MDK-ARM.
This error appears in the compilation:
../Src/stm32f1xx_it.c(193): Error: # 20: identifier "USART_IT_RXNE" is undefined.
How do I solve this?
Ronaldo Martins

code:

Void USART1_IRQHandler (void)
{ If (USART_GetITStatus (USART1, USART_IT_RXNE)! = RESET) // enter interrupt when STM32 receice data. {

USART_Temp_Data = USART_ReceiveData (USART1); }
}

  • The traditional way?

    Scan the available files to search for the symbol. Figure out if it isn't seen by the compiler because you have missed an include or a define or if there is some bug somewhere. As a workaround, the processor documentation should contain the register definition where you can see which bit that contains this flag.

    Or look for sample UART projects for your processor and figure out how they manage to check this flag bit.