Re: [PATCH] Fix STM32F2XX USART data register readout

2021-11-29 Thread Olivier Heriveaux
If I understand correctly (I'm not a QEmu internals expert), yes this is what happens. Maybe stm32f2xx_usart_can_receive() is also called but since the USART_SR_RXNE flag is reset before the USART_DR is read, it does not prevent reading the next character. Best regards, Olivier Hériveaux Le lun.

Re: [PATCH] Fix STM32F2XX USART data register readout

2021-11-29 Thread Alistair Francis
On Mon, Nov 29, 2021 at 12:46 AM Olivier Hériveaux wrote: > > Fix issue where the data register may be overwritten by next character > reception before being read and returned. > > Signed-off-by: Olivier Hériveaux Reviewed-by: Alistair Francis Alistair > --- > hw/char/stm32f2xx_usart.c | 3 +

Re: [PATCH] Fix STM32F2XX USART data register readout

2021-11-29 Thread Peter Maydell
On Sun, 28 Nov 2021 at 12:07, Olivier Hériveaux wrote: > > Fix issue where the data register may be overwritten by next character > reception before being read and returned. > > Signed-off-by: Olivier Hériveaux > --- > hw/char/stm32f2xx_usart.c | 3 ++- > 1 file changed, 2 insertions(+), 1 delet

[PATCH] Fix STM32F2XX USART data register readout

2021-11-28 Thread Olivier Hériveaux
Fix issue where the data register may be overwritten by next character reception before being read and returned. Signed-off-by: Olivier Hériveaux --- hw/char/stm32f2xx_usart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/char/stm32f2xx_usart.c b/hw/char/stm32f2xx_usar