cmsdk_apb_uart doesn't trigger RX interrupt in the "mps2-an500" board.

The QEMU source commit: 917ac07f9a

I wrote a bare-metal driver for cmsdk_apb_uart on mps2-an500 board.

This board is based on Cortex-M7. It has 5 instances of this UART. See DAI0500B.

I send data to UART0 and expect a RX interrupt to be triggered.

After a few successful RX interrupts, the interrupt stops to be triggered.

According to DDI0479D, below is the cmsdk_apb_uart register interface:

image

I dumped the UART registers during the failure as below:

0x40004000:    0x00000036    (DATA)  received data '6'
0x40004004:    0x00000002    (STATE) RX buffer full
0x40004008:    0x0000003f    (CTRL)  RX/TX enabled, RX/TX interrupt enabled, RX/TX overrun interrupt enabled.
0x4000400c:    0x00000002    (INT STATUS_CLEAR)  RX interrupt is happening

The UART0 RX and TX interrupts are correctly enabled in NVIC. And the above registers state should trigger a RX interrupt.

I think the above state should at least ensure the UART0 RX handler be triggered. But the UART0 RX interrupt handler at IRQ0 won't be triggered after a few successful triggering.

The related QEMU src is https://github.com/qemu/qemu/blob/master/hw/char/cmsdk-apb-uart.c.

Edited by Ming Shao