Hi all,
I'm trying to setup an interrupt-driven UART. UART is able to transmit data, but I don't get the TXRDY interrupt.
Below is my minimal initialisation that outputs one character. The TXRDY is interrupt is enabled, so after transmitting a byte, I expect an interrupt handler to be called; this never happens.
{
NRF_UART_Type* uart_base = NRF_UART0;
nrf_uart_disable(uart_base);
nrf_uart_configure(uart_base, NRF_UART_PARITY_EXCLUDED, NRF_UART_HWFC_DISABLED);
nrf_uart_baudrate_set(uart_base, NRF_UART_BAUDRATE_115200);
//TX on P0.5, no RX
nrf_uart_txrx_pins_set(uart_base, 5, 0x80000000u);
nrf_uart_event_clear(uart_base, UART_EVENTS_TXDRDY_EVENTS_TXDRDY_Msk);
nrf_uart_int_enable(uart_base, UART_INTENSET_TXDRDY_Msk);
sd_nvic_EnableIRQ(UARTE0_UART0_IRQn);
nrf_uart_enable(uart_base);
nrf_uart_txd_set(uart_base, 'A');
nrf_uart_task_trigger(uart_base, NRF_UART_TASK_STARTTX);
}
After running that code I see that EVENTS_TXRDY register, as expected, contains 1. When set, that bit should generate an interrupt. However interrupt handler is never called.
I tried placing a breakpoint on the MBR UART vector, as that is the first that will be called during the interrupt handling. But that breakpoint is never hit.
Other interrupts in the system are running - tested with systick, so they are not disabled globally.
Unfortunately Eclipse can not show NVIC registers to verify that the UART interrupt is not masked in NVIC.