Skip to main content
Graduate
April 1, 2024
Solved

Can't set USART_CR1_RXNEIE to enable

  • April 1, 2024
  • 1 reply
  • 1007 views

I tried to enable RXNEIE with following code:

 

USART2->CR1 = (USART_CR1_TE | USART_CR1_UE | USART_CR1_RE | USART_CR1_RXNEIE); 

 

But when I checked CR1 register, it's still set to 0:

 

gdb: x /8ub 0x40004400
0x40004400:	45	0	0	0	0	0	0	0

 

I checked the manual and there is no requirement for any pre-conditions before enabling the RXNEIE bit. Did I just miss something?

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    45 -> 0x2D (UE, RE, TE & RXNEIE)

    Seems as expected here USART_CR1 +0

    https://www.st.com/resource/en/reference_manual/rm0091-stm32f0x1stm32f0x2stm32f0x8-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

    1 reply

    Graduate II
    April 1, 2024
    JemegenAuthor
    Graduate
    April 1, 2024

    Sorry, It's my fault!