2010-09-26 07:48 AM
USART2 USART_GetITStatus not evaluated correctly
2011-05-17 05:08 AM
I use Ride7 as compiler for an STM32f103RE.
Attached you will find a complete example,which copies data from com1 to com2 and vice versa. When you set a Breakpoint in the USART2 IRQ handler you will see that USART_GetITStatus us not evakuated correcty. You can simply add this function in the STM32F10x_StdPeriph_Lib_V3.1.2 template.2011-05-17 05:08 AM
Looks to be Ok. And IRQ's certainly work on USART[1..3]
Others have had problems with RESET being define as something non-zero. Try using != 0 What compiler are you using? What assembler code is being generated? Does the behaviour change if you are not debugging it? What is the value you the USART interrupt register when it enters the IRQ? Can you post/attach a complete compilable example?2011-05-17 05:08 AM
2011-05-17 05:08 AM
Will take a look when I get a chance.
Two quick observations, the first, more than one interrupt bit can be set at once. So the IF ELSE IF ELSE .. construct will only address the first it encounters. Second, observing that an interrupt is set does not clear the interrupt (ie IT_ORE, IT_LBD). If you do not perform an action to clear the interrupt the M3 will keep servicing the interrupt over-and-over.2011-05-17 05:08 AM
Hello,
thank you for the hints. The error was I didn't switch on the right clock: RCC_APB2PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE); RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);