Skip to content

Commit 6698355

Browse files
committed
drivers: serial: Fix issue qemu rx cannot input console
The source code is missing the Receive enable in serial poll-in function so the status flag will never become affect and data will never be read Add the RE write before checking for receive status flag Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
1 parent 9724438 commit 6698355

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/serial/uart_renesas_rx_sci_qemu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ LOG_MODULE_REGISTER(renesas_rx_uart_sci_qemu, CONFIG_UART_LOG_LEVEL);
5151
#define SSR_RDRF_LEN (1)
5252
#define SSR_TDRE_POS (7)
5353
#define SSR_TDRE_LEN (1)
54+
#define SCI_SCR_RE (1 << 4)
5455

5556
struct uart_renesas_rx_sci_qemu_cfg {
5657
mem_addr_t regs;
@@ -77,6 +78,7 @@ static void uart_renesas_rx_qemu_write_8(const struct device *dev, uint32_t offs
7778

7879
static int uart_renesas_rx_sci_qemu_poll_in(const struct device *dev, unsigned char *c)
7980
{
81+
uart_renesas_rx_qemu_write_8(dev, SCR, SCI_SCR_RE);
8082
if ((uart_renesas_rx_qemu_read_8(dev, SSR) & REG_MASK(SSR_RDRF)) == 0) {
8183
/* There are no characters available to read. */
8284
return -1;

0 commit comments

Comments
 (0)