Skip to main content
Associate II
April 1, 2024
Solved

Can't set USART_CR1_RXNEIE to enable

  • April 1, 2024
  • 2 replies
  • 1025 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

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
April 1, 2024
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
JemegenAuthor
Associate II
April 1, 2024

Sorry, It's my fault!