Hi all
Previously, I used the nRF52832 with the interrupt-driven UART at 1Mbaud. But due to SoftDevice interrupts that blocked the UART-RX-IRQ for more than 6 bytes, I tried to use the UARTE with EasyDMA.
I need to receive an arbitrary amount of bytes and can therefore not wait until the RX buffer is filled. So, I tried the suggestion from this thread, by enabling the shortcut between ENDRX and STARTRX and by triggering the STOPRX task in a certain interval.
Now, I check in a certain interval if the RXDRDY event occurred. If yes, I set the second RX buffer as the active buffer and trigger afterwards the STOPRX task. After the ENDRX event occurred, I copy the amount of received bytes.
My code looks like this:
I assumed that due to the enabled shortcut the reception should immediately switch to the second buffer. But it seems that I lose some bytes (or get corrupted bytes) when the STOPRX task is executed during the reception of bytes. E.g. the byte stream "00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF" is sent to the nRF52, but I receive in RX_BUF_1 the bytes "00 11 22 33 44 55 66" and in RX_BUF_2 the bytes "2C DB DD EE FF". Here is a trace from the flow:
Should the STOPRX task not be triggered during the reception of bytes or am I missing something? Do you know this problem?
Many thanks in advance.
Best regards