2014-06-18 11:24 AM
Could someone please confirm the following issue ?
, p.706/914 states that: ''ORE: Overrun error (...) An interrupt is generated if RXNEIE=1 or EIE = 1 in the USARTx_CR1 register.'' The hardware indeed appears to work that way, as I do indeed get ORE interrupts when only RXNEIE is enabled. Now, in stm32f0xx_usart.c/.h: since USART_IT_ORE is defined as 0x00030300, USART_GetITStatus() gets its itmask from USARTx->CR3, bit 0 (which corresponds to EIE). Therefore, contrary to what is stated in the documentation, RXNEIE is never checked, and USART_GetITStatus(..., USART_IT_ORE) will always return RESET when called from an ISR triggered by an ORE condition while EIE is disabled, even if RXNEIE is enabled. Now, if EIE=0 and RXNEIE=1, this is a big problem if USART_GetITStatus(..., USART_IT_ORE) is used to detect and reset the pending ORE interrupt: it will never catch the interrupt condition and the ISR will keep being called, freezing the MCU. I believe this is the problem being encountered in the following threads: - [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/USART%20ORE%3D1%2c%20but%20RXNE%3D0&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=1049]thread 1 - [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/two%20usart%20problem&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=3891]thread 22014-09-01 05:37 AM
[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/two%20usart%20problem&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=3891]
2014-09-06 12:04 AM
The post is very useful - thank you.
On my STM32F051 :not working: if (USART_GetFlagStatus(USART1, USART_IT_ORE) != RESET) { USART_ClearFlag(USART1, USART_IT_ORE); }good working: if ((USART1->ISR & 0x8)!=0) { USART1->ICR |= 0x8; }2014-09-09 04:06 AM
Hi raymond.alexandre,
After discussion with development team, it turned out that this behavior is confirmed. Thus the ORE interrupt is generated only if the EIE interrupt is enabled (not when RXNEIE interrupt)Thanks for the feedback.Regards.2014-09-30 12:29 AM
> After discussion with development team, it turned out that this behavior is confirmed.
> Thus the ORE interrupt is generated only if the EIE interrupt is enabled (not when RXNEIE interrupt) IMO, Alexandre said exactly the opposite:> The hardware indeed appears to work that way, as I do indeed get ORE interrupts when only RXNEIE is enabled.
So, can you please go back to your development team and ask them, which one of these is true? JW[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/two%20usart%20problem&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=3891]