This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UART interrupt doesn't occur for subsequent receptions

I am writing my own UART driver and having trouble getting subsequent interrupts. The first time I see the interrupt occurs but nothing after.

According to the product spec, RXDRDY event register should be cleared before RXD register is read.

That's what I'm doing inside the IRQ handler though the interrupt only happens once.

void UARTE0_UART0_IRQHandler(void)
    {        
        bool isDataReceived = pInstance->getNrfEventStatus(NRF_UART_EVENT_RXDRDY);
        bool rxIrqEnabled = pInstance->getNrfRegStatus(UARTx->INTENSET, NRF_UART_INT_MASK_RXDRDY);
        bool rxToIrqEnabled = pInstance->getNrfEventStatus(NRF_UART_INT_MASK_RXTO);
    
        if (rxIrqEnabled && isDataReceived)
        {
	        pInstance->setNrfEvent(NRF_UART_EVENT_RXDRDY, DISABLE); // disable event
	        uint32_t dataRxd = UARTx->RXD;    // read RXD register
	        pFifoRx->enque(dataRxd);    // write to FIFO
        }
        // ...
    }

Parents Reply Children
No Data
Related