Bug Fix: UART IRQ Freezing

It was found that receiving UART data too rapidly would completely brick the UART peripheral (no further UART IRQs would be generated).

To brick the peripheral all of the following needs to be true.
1. A BLE connection is active
2. Serial speed is set fast enough (>= 115,200)
3. A continuous stream of Serial data needs to be received

Since interrupt timing is no longer guaranteed when the SoftDevice has an active BLE connection it is much more likely for UART data to be received when inside the UART IRQ. Clearing nrfUart->EVENTS_RXDRDY at the end of the IRQ increases the likelyhood of the system setting a pending IRQ before the current IRQ loop has cleared nrfUart->EVENTS_RXDRDY. If this occurs then the UART IRQ will be called again, but nrfUart->EVENTS_RXDRDY will be 0. Since nrfUart->RXD is no longer being cleared overruns start occuring and for some unknown reason the UART IRQ stops trigerring.
This commit is contained in:
ChristofR authored and GitHub committed 2018-06-07 15:51:57 +02:00
1 parent 47ae6e88fd
commit 0c0026029f
1 file changed
+1 -1
+1 -1
View File
@@ -193,7 +193,7 @@ void Uart::IrqHandler()
{
if (nrfUart->EVENTS_RXDRDY)
{
nrfUart->EVENTS_RXDRDY = 0x0UL;
nrfUart->EVENTS_RXDRDY = 0x0UL;
rxBuffer.store_char(nrfUart->RXD);
}