Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF58232 UARTE RX EasyDMA Pointer

Hi,

I use EasyDMA with UART.

I'm in permanent reception and the received octects go directly into a memory buffer.

When the buffer is full, the writing starts again at the beginning.

Fullscreen
1
2
3
4
5
6
static uint8_t rxUarteBuffer[200]={0};
NRF_UARTE0->SHORTS = (UARTE_SHORTS_ENDRX_STARTRX_Enabled << UARTE_SHORTS_ENDRX_STARTRX_Pos);
NRF_UARTE0->RXD.PTR = (uint32_t)((uint8_t *) rxUarteBuffer);
NRF_UARTE0->RXD.MAXCNT = sizeof(rxUarteBuffer);
NRF_UARTE0->TASKS_STARTRX = 1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

NRF_UARTE0->RXD.AMOUNT is useless because there is no real end of transaction.

Nevertheless there must be a way to know where the next byte will be stored ?

How can I know where the pointer is in my buffer? I don't want to count the number of bytes received per interrupt (EVENTS_RXDRDY)

Someone can help me ?

Thanks in advance.

Best regards