Skip to main content
Visitor II
November 27, 2025
Question

NUCLEO-U031R8 – Unable to Read/Write UART Registers in Interrupt Mode

  • November 27, 2025
  • 3 replies
  • 199 views

Hello everyone,

We are developing a custom UART driver for the NUCLEO-U031R8 board where both transmit and receive operations are handled through interrupts (no HAL/LL blocking calls). However, we are facing a major issue: we are unable to reliably read from or write to the UART peripheral registers.

We have tried accessing USART registers directly (e.g., USARTx->RDR, USARTx->TDR, ISR, CR1, etc.), but the values do not change as expected during runtime. Because of this, our interrupt-driven communication never starts properly.

We have verified:

  • Clock to USART is enabled

  • GPIO pins are configured for the correct alternate function

  • NVIC interrupt is enabled

  • CR1 bits for UE, TE, RE, RXNEIE, TXEIE are set

Despite that, both TXE and RXNE interrupt behaviors do not match what we expect, and register access seems unresponsive.

Has anyone encountered similar issues on STM32U0 series or this particular NUCLEO board?
Any guidance or known pitfalls (clocking, low-power modes, register protections, etc.) would be greatly appreciated.

Thank you!

    This topic has been closed for replies.

    3 replies

    Super User
    November 27, 2025

    Welcome to the forum.

    Please see How to write your question to maximize your chances to find a solution for best results.

     

    Please post a minimum but complete example which illustrates the issue.

     

    PS:

    Have you tried the ST (HAL-based)  examples for reference?

    Graduate II
    November 27, 2025

    A debug view of the registers may interfere with normal operation of the UART.

    Best to hold values in RAM and inspect those to understand status and errors in UART.

    Watch for error status that need to be cleared, like noise, parity, overflow, etc.

    Super User
    November 27, 2025

    > the values do not change as expected during runtime.

    They aren't memory addresses; they are registers that interface with a peripheral. When you write to TDR, don't expect to be able to read out what you wrote. Reading RDR in the debugger removes data from the peripheral--so don't.