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

With NRF52840 UARTE0, I need to increase the buffer size from 1 byte to 64 bytes. But with this cannot receive 1 byte packet.

Hi,

I'm using a buffer size of 64 bytes using function

nrf_drv_uart_rx(&app_uart_inst, rx_buffer, 64);

When I receive only one byte packet from the remote, I get EVENT_RXDRDY (which I expect). I then wait for about 10 ms.

1. EVENT_RXDRDY

2. delay_ms(10)

3. trigger FLUSHRX

4. Read UARTE register AMOUNT

I get AMOUNT = 0 all the time

Why I'm not getting AMOUNT = 1?

This code works if the buffer size is set to 1.

Please help. Let me know I need to do some trick.

Parents
  • To add, I want to use easyDMA for buffer of size 64 bytes but if only one byte is received for a long time, I internally generate FLUSHRX TASK. I see that immediately that one byte is in the RAM after 1 ms, but I do not get the AMOUNT register populated nor do I get ENDRX interrupt.

    I need to implement the interrupt so that I can get as many as 64 bytes of data as a block but also be able to receive just one byte packet with the same routine. How can I achieve it?

Reply
  • To add, I want to use easyDMA for buffer of size 64 bytes but if only one byte is received for a long time, I internally generate FLUSHRX TASK. I see that immediately that one byte is in the RAM after 1 ms, but I do not get the AMOUNT register populated nor do I get ENDRX interrupt.

    I need to implement the interrupt so that I can get as many as 64 bytes of data as a block but also be able to receive just one byte packet with the same routine. How can I achieve it?

Children
No Data
Related