STM32F4 UART - USART DR register: How to preserve reserved field?
The documentation for the STM32F4 in RM0090 Revision 22 (May 2026) says very clearly that reserved fields in the U(S)ART registers must be kept at their reset values. It also says that U(S)ART registers may be accessed with 16-bit or 32-bit accesses.(See screen caps below.)
The normal way to preserve the existing contents of a field in an N-bit register access is to implement a read-modify-write (RMW) on N-bit values. (For the U(S)ARTs, N is 16 or 32). Read the existing N-bit value, update the bits for the fields being written, and then write the merged N-bit value back. That way, you can preserve the contents of reserved fields without storing a shadow copy of those fields anywhere in RAM.
Note: This actually preserves the current contents of any reserved fields, not the reset-time contents, modulo any race conditions on the RMW. I understand the purpose of preserving the reserved field is to enable forward compatibility with newer peripherals. Therefore, I don’t expect the contents of any writable field hidden behind the reserved field to change in a way that would break things if I simply preserved the current value. I plan to use the RMW technique on other registers in this peripheral and other STM32 peripherals that require preserving the contents of reserved fields.
However, the USART_DR register is sensitive to both reads and writes. Reads pop incoming receive data from the internal RDR register, whereas writes push transmit data to the internal TDR register. That’s pretty common for U(S)ARTs.The RXD and TXD fields are only 9 bits wide, which means the register has 7 or 23 reserved bits that must be preserved.
Because reads pop incoming receive data, the RMW approach won’t work for a register such as USART_DR in the general case. (It might work for half-duplex applications.) The read in the RMW sequence will pop any receive data when I try to transmit.
I suspect this is just a documentation copy/paste error—i.e. a generic warning intended to future-proof code was applied to this register without considering the implications. It seems highly likely that the USARTs and UARTs ignore writes to bits 31:9 in the register, and that I can simply write the transmit data to USART_DR.TXD, possibly after clearing bits 9 and up..
If that’s not the case, do I really need to read USART_DR in each U(S)ART I’m using at reset time to save the reserved field a shadow copy somewhere? That would be a seriously weird architecture for a U(S)ART. I can’t think of a U(S)ART I’ve encountered in the last 35 years or so that behaves that way. (I’d also wonder exactly how the DMA interfaces with it.) But, this is my first time using an STM32 family member, and I’ve dealt with some seriously weird devices over the years. 😄
I ask as I’m porting a proprietary low-level abstraction library to support STM32F40x. I’m not using any of the standard libraries offered by ST.

..

